Package com.tangosol.net
Class TcpDatagramSocketProvider.DefaultDependencies
- java.lang.Object
-
- com.tangosol.net.TcpDatagramSocketProvider.DefaultDependencies
-
- All Implemented Interfaces:
TcpDatagramSocketProvider.Dependencies
- Enclosing class:
- TcpDatagramSocketProvider
public static class TcpDatagramSocketProvider.DefaultDependencies extends Object implements TcpDatagramSocketProvider.Dependencies
DefaultDependenceis is a basic implementation of the Dependencies interface providing "setter" methods for each property.Additionally this class serves as a source of default dependency values.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.oracle.coherence.common.net.SocketProvider
m_delegateSocketProvider
Underlying TCP socket providerprotected boolean
m_fBlocking
Specifies if the provider is to produce blocking datagram sockets.protected int
m_nAdvanceFrequency
The TcpDatagramSocket advance frequency.
-
Constructor Summary
Constructors Constructor Description DefaultDependencies()
Construct a DefaultDependencies object.DefaultDependencies(TcpDatagramSocketProvider.Dependencies deps)
Construct a DefaultDependencies object copying the values from the specified dependencies object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static void
ensureArgument(Object o, String sName)
Ensure that the specified object is non-nullint
getAdvanceFrequency()
Get the frequency at which the DatagramSocket will advance over the sub-sockets during receivecom.oracle.coherence.common.net.SocketProvider
getDelegateSocketProvider()
Return the SocketProvider to use in producing the underling sockets which will be wrapped with DatagramSocket.boolean
isBlocking()
Check if datagram sockets should be blocking the use of "blocking" datagram sockets is not meant for production use and this setting should remain undocumentedvoid
setAdvanceFrequency(int frequency)
Set frequency for datagram socketvoid
setBlocking(boolean fBlocking)
Set if datagram socket is blockingTcpDatagramSocketProvider.DefaultDependencies
setDelegateSocketProvider(com.oracle.coherence.common.net.SocketProvider provider)
Set Delegate SocketProviderprotected TcpDatagramSocketProvider.DefaultDependencies
validate()
Validate the dependencies.
-
-
-
Field Detail
-
m_delegateSocketProvider
protected com.oracle.coherence.common.net.SocketProvider m_delegateSocketProvider
Underlying TCP socket provider
-
m_fBlocking
protected boolean m_fBlocking
Specifies if the provider is to produce blocking datagram sockets.
-
m_nAdvanceFrequency
protected int m_nAdvanceFrequency
The TcpDatagramSocket advance frequency.
-
-
Constructor Detail
-
DefaultDependencies
public DefaultDependencies()
Construct a DefaultDependencies object.
-
DefaultDependencies
public DefaultDependencies(TcpDatagramSocketProvider.Dependencies deps)
Construct a DefaultDependencies object copying the values from the specified dependencies object- Parameters:
deps
- the dependencies to copy, or null
-
-
Method Detail
-
getDelegateSocketProvider
public com.oracle.coherence.common.net.SocketProvider getDelegateSocketProvider()
Return the SocketProvider to use in producing the underling sockets which will be wrapped with DatagramSocket.- Specified by:
getDelegateSocketProvider
in interfaceTcpDatagramSocketProvider.Dependencies
- Returns:
- the delegate SocketProvider
-
setDelegateSocketProvider
public TcpDatagramSocketProvider.DefaultDependencies setDelegateSocketProvider(com.oracle.coherence.common.net.SocketProvider provider)
Set Delegate SocketProvider- Parameters:
provider
-
-
isBlocking
public boolean isBlocking()
Check if datagram sockets should be blocking the use of "blocking" datagram sockets is not meant for production use and this setting should remain undocumented- Specified by:
isBlocking
in interfaceTcpDatagramSocketProvider.Dependencies
- Returns:
- true if use blocking sockets
-
setBlocking
@Injectable("blocking") public void setBlocking(boolean fBlocking)
Set if datagram socket is blocking- Parameters:
fBlocking
-
-
getAdvanceFrequency
public int getAdvanceFrequency()
Get the frequency at which the DatagramSocket will advance over the sub-sockets during receive- Specified by:
getAdvanceFrequency
in interfaceTcpDatagramSocketProvider.Dependencies
- Returns:
- int frequency
-
setAdvanceFrequency
@Injectable("advance-frequency") public void setAdvanceFrequency(int frequency)
Set frequency for datagram socket- Parameters:
frequency
-
-
validate
protected TcpDatagramSocketProvider.DefaultDependencies validate() throws IllegalArgumentException
Validate the dependencies.- Returns:
- this object
- Throws:
IllegalArgumentException
- if the dependencies are invalid
-
ensureArgument
protected static void ensureArgument(Object o, String sName)
Ensure that the specified object is non-null- Parameters:
o
- the object to ensuresName
- the name of the corresponding parameter- Throws:
IllegalArgumentException
- if o is null
-
-