|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.dream.AbstractComponent
org.objectweb.dream.channel.IPSocketManagerCachingImpl
This component manage a cache of SocketState
.
Nested Class Summary | |
protected class |
IPSocketManagerCachingImpl.CacheEntry
|
Field Summary | |
protected boolean |
blocking
|
protected Map |
cache
|
static String |
DELEGATE_IP_SOCKET_MANAGER
The name of the client interface used to retreive a socket when it can't be found in the cache. |
protected IPSocketManager |
delegateSocketManagerItf
|
protected IPSocketManagerCachingImpl.CacheEntry |
lruHead
|
protected IPSocketManagerCachingImpl.CacheEntry |
lruTail
|
protected int |
nbMaxSocket
|
protected IPSocketManagerCachingImpl.CacheEntry |
reusableKey
|
protected Map |
reversCache
|
Fields inherited from class org.objectweb.dream.AbstractComponent |
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC |
Fields inherited from interface org.objectweb.dream.channel.IPSocketManager |
ITF_NAME |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
STARTED, STOPPED |
Constructor Summary | |
IPSocketManagerCachingImpl()
|
Method Summary | |
void |
bindFc(String clientItfName,
Object serverItf)
|
boolean |
getBlocking()
Returns the blocking parameter value. |
int |
getNbMaxSocket()
Returns the number of maximum open sockets. |
SocketState |
getSocket(InetAddress address,
int port)
Returns a socket that can be used to send message to the ChannelIn identified by the given IP address and port. |
String[] |
listFc()
|
void |
releaseSocket(SocketState socketState,
boolean error)
Releases the given SocketStateImpl . |
void |
setBlocking(boolean blocking)
Sets the blocking property of this IPSocketManager. |
void |
setNbMaxSocket(int nbMaxSocket)
Sets the nbMaxSocket attribute value. |
Methods inherited from class org.objectweb.dream.AbstractComponent |
beforeFirstStart, getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DELEGATE_IP_SOCKET_MANAGER
protected IPSocketManagerCachingImpl.CacheEntry reusableKey
protected Map cache
protected Map reversCache
protected IPSocketManagerCachingImpl.CacheEntry lruHead
protected IPSocketManagerCachingImpl.CacheEntry lruTail
protected boolean blocking
protected int nbMaxSocket
protected IPSocketManager delegateSocketManagerItf
Constructor Detail |
public IPSocketManagerCachingImpl()
Method Detail |
public SocketState getSocket(InetAddress address, int port) throws IOException, InterruptedException
IPSocketManager
getSocket
in interface IPSocketManager
address
- the address of the ChannelIn.port
- the port of the ChannelIn.
InterruptedException
- if the component is interrupted while waiting
for a socket to be released.
IOException
- if the socket can't be opened.IPSocketManager.getSocket(InetAddress, int)
public void releaseSocket(SocketState socketState, boolean error)
IPSocketManager
SocketStateImpl
.
releaseSocket
in interface IPSocketManager
socketState
- the socket state to release.error
- true
if an exception has been catched while
sending the message, false
otherwise.IPSocketManager.releaseSocket(SocketState, boolean)
public int getNbMaxSocket()
IPSocketManagerCachingAttributeController
getNbMaxSocket
in interface IPSocketManagerCachingAttributeController
nbMaxSocket
attribute value.IPSocketManagerCachingAttributeController.getNbMaxSocket()
public void setNbMaxSocket(int nbMaxSocket)
IPSocketManagerCachingAttributeController
nbMaxSocket
attribute value.
setNbMaxSocket
in interface IPSocketManagerCachingAttributeController
nbMaxSocket
- the new nbMaxSocket
attribute value.IPSocketManagerCachingAttributeController.setNbMaxSocket(int)
public void setBlocking(boolean blocking)
IPSocketManagerCachingAttributeController
true
then the manager waits if the required socket is in
use. Otherwise, it raises an exeption.
setBlocking
in interface IPSocketManagerCachingAttributeController
blocking
- the boolean value to set.IPSocketManagerCachingAttributeController.setBlocking(boolean)
public boolean getBlocking()
IPSocketManagerCachingAttributeController
getBlocking
in interface IPSocketManagerCachingAttributeController
IPSocketManagerCachingAttributeController.getBlocking()
public String[] listFc()
listFc
in interface BindingController
BindingController.listFc()
public void bindFc(String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
bindFc
in interface BindingController
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
BindingController.bindFc(String,
Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |