|
|||||||||
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.protocol.messagePassing.UDPProtocolImpl
public class UDPProtocolImpl
Implementation of the UDP protocol.
Nested Class Summary | |
---|---|
protected class |
UDPProtocolImpl.ReaderTask
|
protected class |
UDPProtocolImpl.Session
|
Field Summary | |
---|---|
protected static String |
hostName
|
Fields inherited from class org.objectweb.dream.AbstractComponent |
---|
bindingLogger, fcNeedAsyncStart, fcState, lifeCycleLogger, logger, weaveableC |
Fields inherited from interface org.objectweb.dream.protocol.messagePassing.UDPProtocol |
---|
ADDRESS, PORT, PORT_RANGE |
Fields inherited from interface org.objectweb.dream.protocol.messagePassing.MessagePassingProtocol |
---|
FROM_CHUNK_NAME |
Fields inherited from interface org.objectweb.dream.protocol.Protocol |
---|
ITF_NAME, LOWER_PROTOCOL_ITF_NAME |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
---|
STARTED, STOPPED |
Constructor Summary | |
---|---|
UDPProtocolImpl()
|
Method Summary | |
---|---|
protected void |
beforeFirstStart(Component componentItf)
|
void |
bindFc(String clientItfName,
Object serverItf)
|
ExportIdentifier |
createExportIdentifier(Map info,
ExportIdentifier[] next)
Creates a new export identifier with the provided info |
IPExportIdentifier |
createExportIdentifier(String hostName,
int port)
Utility method. |
MessagePassingOutgoingPush |
export(IncomingPush incomingPushItf,
int port,
int range,
String fromChunkChunk)
Utility method. |
MessagePassingOutgoingPush |
export(IncomingPush incomingPushItf,
Map hints)
Creates an access point and returns an interface that can be used to send messages through it. |
protected UDPProtocolImpl.Session |
getAvailable()
|
int |
getPort()
Returns the default value of the UDPProtocol.PORT hint. |
int |
getRecvBufferSize()
Returns the recvBufferSize attribute value. |
protected void |
initSession(UDPProtocolImpl.Session session)
|
String[] |
listFc()
|
protected void |
setAvailable(UDPProtocolImpl.Session session)
|
void |
setPort(int port)
Sets the default value of the UDPProtocol.PORT hint. |
void |
setRecvBufferSize(int recvBufferSize)
Sets the size of buffer used in DatagramPacket when
receiving message. |
protected void |
setThreadPoolManager(ThreadPoolManager threadPoolManager)
|
Methods inherited from class org.objectweb.dream.AbstractComponent |
---|
bindFc, getFcNeedAsyncStart, getFcState, initComponent, lookupFc, prepareStopFc, setLogger, startFc, stopFc, unbindFc |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static String hostName
Constructor Detail |
---|
public UDPProtocolImpl()
Method Detail |
---|
public MessagePassingOutgoingPush export(IncomingPush incomingPushItf, Map hints) throws ExportException
MessagePassingProtocol
IncomingPush
interface.
export
in interface MessagePassingProtocol
incomingPushItf
- the interface on which message received on the
created access point will be passed, may be null
.hints
- additional parameters, can be null
.
ExportException
- if the export process fails.MessagePassingProtocol.export(IncomingPush, Map)
public ExportIdentifier createExportIdentifier(Map info, ExportIdentifier[] next) throws InvalidExportIdentifierException
Protocol
createExportIdentifier
in interface Protocol
info
- the info used to create the export identifier.next
- the export identifier of the lower level protocols.
InvalidExportIdentifierException
- if the export identifier can't be
created.Protocol.createExportIdentifier(Map,
ExportIdentifier[])
public MessagePassingOutgoingPush export(IncomingPush incomingPushItf, int port, int range, String fromChunkChunk) throws ExportException
UDPProtocol
export
in interface UDPProtocol
incomingPushItf
- the interface on which message received on the
created access point will be passed.port
- the port of the created UDP socket. range
- the range of ports on which the UDP protocol will try to open
socket. fromChunkChunk
- If not null
a
ExportIdentifierChunk
will
be added to every received messages (see MessagePassingProtocol.FROM_CHUNK_NAME
).
ExportException
- if the export process fails.UDPProtocol.export(IncomingPush, int, int, String)
public IPExportIdentifier createExportIdentifier(String hostName, int port)
UDPProtocol
createExportIdentifier
in interface UDPProtocol
UDPProtocol.createExportIdentifier(String, int)
protected void setAvailable(UDPProtocolImpl.Session session)
protected UDPProtocolImpl.Session getAvailable()
protected void initSession(UDPProtocolImpl.Session session)
protected void setThreadPoolManager(ThreadPoolManager threadPoolManager)
protected void beforeFirstStart(Component componentItf) throws IllegalLifeCycleException
beforeFirstStart
in class AbstractComponent
IllegalLifeCycleException
AbstractComponent.beforeFirstStart(Component)
public int getPort()
UDPProtocolAttributeController
UDPProtocol.PORT
hint.
getPort
in interface UDPProtocolAttributeController
port
attribute's value.UDPProtocolAttributeController.getPort()
public void setPort(int port)
UDPProtocolAttributeController
UDPProtocol.PORT
hint.
setPort
in interface UDPProtocolAttributeController
port
- the new port
attribute's value.UDPProtocolAttributeController.setPort(int)
public int getRecvBufferSize()
UDPProtocolAttributeController
recvBufferSize
attribute value.
getRecvBufferSize
in interface UDPProtocolAttributeController
recvBufferSize
attribute value.UDPProtocolAttributeController.getRecvBufferSize()
public void setRecvBufferSize(int recvBufferSize)
UDPProtocolAttributeController
DatagramPacket
when
receiving message.
setRecvBufferSize
in interface UDPProtocolAttributeController
recvBufferSize
- the new recvBufferSize
attribute
value.UDPProtocolAttributeController.setRecvBufferSize(int)
public String[] listFc()
listFc
in interface BindingController
BindingController.listFc()
public void bindFc(String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
bindFc
in interface BindingController
bindFc
in class AbstractComponent
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
BindingController.bindFc(String,
Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |