|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.epfl.lsr.apex.APEXManager ch.epfl.lsr.apex.APEXEndpointManager
The APEXEndpointManager
handles the interface between
an endpoint and a relay. It must be initialized by every application
implementing APEXEndpointProcess
to be able to attach
to the APEX mesh and to send messages.
Field Summary |
Fields inherited from class ch.epfl.lsr.apex.APEXManager |
application, lockedIdentifiers, messageTable, port, PROCESSTYPE_ENDPOINT, PROCESSTYPE_RELAY, SERVICEPRIORITIES, services, SERVICETABLE, transactionTable |
Constructor Summary | |
APEXEndpointManager(APEXEndpointProcess application,
String serviceConfigurationFile)
Instantiates a new APEX endpoint manager using the standard port 912 for apex-edge-connections (say to its relay). |
|
APEXEndpointManager(APEXEndpointProcess application,
String serviceConfigurationFile,
int edgePort)
Instantiates a new APEX endpoint manager using a specified port number for apex-edge-connections (say to its relay). |
Method Summary | |
void |
attachAs(APEXEndpointAddress aea,
APEXStatus status)
Allows an application to attach as the specified endpoint and to set a listener on the APEXStatus .
|
HashSet |
getAttachedEndpoints()
Returns a set of the attached endpoints. |
int |
getUniqueTransID(APEXStatus handler,
APEXEndpointAddress aea)
Returns a unique transaction identifier for the specified endpoint address. |
void |
handleIncomingMessage(APEXMessage message,
Object receivingChannelID)
When a message has been received on a connection it calls its manager's ' handleIncomingMessage ' method. |
void |
messageDiscarded(APEXDataMessage m,
int code,
String reason)
This mesthod is called when a connection wasn't able to send an ' APEXDataMessage ', say a
(where x ! |
void |
messageSent(APEXDataMessage m,
APEXReply reply)
This mesthod is called when an ' APEXDataMessage ' is
successfully sent on a connection, say an
element has been received. |
void |
removeAttachment(APEXEndpointAddress aea)
Removes an attachment of the register and sends a notification to the application Internal use only! |
void |
removeAttachments(HashSet aeas)
Removes a set of attachments of the register and sends a notification to the application Internal use only! |
int |
sendAPEXDataMessage(APEXDataMessage message)
Sends an APEXDataMessage to the recipients specified
within the object.
|
int |
sendMessage(APEXDataMessage message,
APEXStatus status)
Sends an APEXDataMessage to the recipients specified
within the object.
|
int |
sendMessage(APEXEndpointAddress originator,
APEXEndpointAddress recipient,
byte[] content,
String contentType,
String transferEncoding,
APEXStatus status)
Sends a data message (MIME Multipart) to the specified recipient endpoint address containing the specified byte content. |
int |
sendMessage(APEXEndpointAddress originator,
APEXEndpointAddress recipient,
String content,
APEXStatus status)
Sends a data message to the specified recipient endpoint address containing the specified textual / XML content. |
int |
sendMessage(APEXEndpointAddress originator,
HashSet recipients,
byte[] content,
String contentType,
String transferEncoding,
APEXStatus status)
Sends a data message (MIME Multipart) to the specified recipient endpoint addresses containing the specified byte content. |
int |
sendMessage(APEXEndpointAddress originator,
HashSet recipients,
String content,
APEXStatus status)
Sends a data message to the specified recipient endpoint addresses containing the specified textual / XML content. |
void |
setAttachedAs(APEXEndpointAddress aea)
Registeres an attached endpoint in the endpoint manager and sends a notification to the application. |
void |
terminate(APEXEndpointAddress aea,
APEXStatus status)
Terminates an attachment as the specified endpoint address or throws an APEXException if the manager is not attached as the specified endpoint |
void |
terminate(APEXEndpointAddress aea,
int code,
APEXStatus status)
Terminates an attachment as the specified endpoint address or throws an APEXException if the manager is not attached as the specified endpoint |
void |
terminate(APEXEndpointAddress aea,
int transID,
int code,
String content,
String xmlLang,
APEXStatus status)
Terminates an attachment as the specified endpoint address or throws an APEXException if the manager is not attached as the specified endpoint |
void |
terminate(APEXEndpointAddress aea,
int code,
String content,
APEXStatus status)
Terminates an attachment as the specified endpoint address or throws an APEXException if the manager is not attached as the specified endpoint |
void |
terminate(APEXEndpointAddress aea,
int code,
String content,
String xmlLang,
APEXStatus status)
Terminates an attachment as the specified endpoint address or throws an APEXException if the manager is not attached as the specified endpoint |
int |
terminate(APEXTerminateMessage atm,
Object receivingChannelID)
Is called when an terminate element is received a status
code (for the reply is returned). |
Methods inherited from class ch.epfl.lsr.apex.APEXManager |
addTransaction, debug, getApplication, getFromTable, getFromTableAndLock, getTransaction, notification, parsePort, putToTable, putToTableAndUnlock, removeAllTransactions, removeFromTable, removeTransaction, sortOptions, unlockTable, validatePort |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public APEXEndpointManager(APEXEndpointProcess application, String serviceConfigurationFile)
application
- An application accepting call-backs (e.g. incoming messages,
notifcations)serviceConfigurationFile
- The file name (path) of an optional service configuration
filepublic APEXEndpointManager(APEXEndpointProcess application, String serviceConfigurationFile, int edgePort) throws APEXException
application
- An application accepting call-backs (e.g. incoming messages,
notifcations)serviceConfigurationFile
- The file name (path) of an optional service configuration
fileedgePort
- The port number to contact the relay(s)
APEXException
- Thrown if the port number is not validMethod Detail |
public int getUniqueTransID(APEXStatus handler, APEXEndpointAddress aea) throws APEXException
handler
- An APEXStatus for events on this transaction identifieraea
- The associated endpoint address (concering the channel)
APEXException
- Thrown if the manager is not (yet) attached as the specified
endpoint addresspublic HashSet getAttachedEndpoints()
public void setAttachedAs(APEXEndpointAddress aea)
Registeres an attached endpoint in the endpoint manager and sends a notification to the application.
Internal use only!
To attach, use attachAs
instead!
aea
- The endpoint address to attachpublic void removeAttachment(APEXEndpointAddress aea)
Removes an attachment of the register and sends a notification to the application
Internal use only!
To release an attachment, use terminate
instead!
aea
- An endpoint address to removepublic void removeAttachments(HashSet aeas)
Removes a set of attachments of the register and sends a notification to the application
Internal use only!
To release an attachment, use terminate
instead!
aeas
- A set of endpoint addresses (APEXEndpointAddress
)public void attachAs(APEXEndpointAddress aea, APEXStatus status)
Allows an application to attach as the specified endpoint and to set a
listener on the APEXStatus
.
The status' getStatus
method can either be used as
blocking directly after attaching or in a status listener thread.
aea
- An endpoint address to attach asstatus
- A status or null
if no status should be setpublic void terminate(APEXEndpointAddress aea, APEXStatus status) throws APEXException
aea
- An endpoint address (attachment) to terminationstatus
- A status listener or null
APEXException
- Thrown if the manager is not attached as the specified
endpointpublic void terminate(APEXEndpointAddress aea, int code, APEXStatus status) throws APEXException
aea
- An endpoint address (attachment) to terminationcode
- A code for termination (application use)status
- A status listener or null
APEXException
- Thrown if the manager is not attached as the specified
endpointpublic void terminate(APEXEndpointAddress aea, int code, String content, APEXStatus status) throws APEXException
aea
- An endpoint address (attachment) to terminationcode
- A code for termination (application use)content
- A textual message or XML contentstatus
- A status listener or null
APEXException
- Thrown if the manager is not attached as the specified
endpointpublic void terminate(APEXEndpointAddress aea, int code, String content, String xmlLang, APEXStatus status) throws APEXException
aea
- An endpoint address (attachment) to terminationcode
- A code for termination (application use)content
- A textual message or XML contentxmlLang
- xml:lang attribute for this terminationstatus
- A status listener or null
APEXException
- Thrown if the manager is not attached as the specified
endpointpublic void terminate(APEXEndpointAddress aea, int transID, int code, String content, String xmlLang, APEXStatus status) throws APEXException
aea
- The endpoint address which originates the termination (rather
domain)transID
- A transaction identifier to terminatecode
- A code for termination (application use)content
- A textual message or XML contentxmlLang
- xml:lang attribute for this terminationstatus
- A status listener or null
APEXException
- Thrown if the manager is not attached as the specified
endpointpublic int sendMessage(APEXEndpointAddress originator, APEXEndpointAddress recipient, String content, APEXStatus status)
originator
- Originator endpoint addressrecipient
- Receipient endpoint addresscontent
- Textual or XML contentstatus
- A status listener or null
public int sendMessage(APEXEndpointAddress originator, HashSet recipients, String content, APEXStatus status) throws APEXParsingException
originator
- Originator endpoint addressrecipients
- A set of receipient endpoint addressescontent
- Textual or XML contentstatus
- A status listener or null
APEXParsingException
public int sendMessage(APEXEndpointAddress originator, APEXEndpointAddress recipient, byte[] content, String contentType, String transferEncoding, APEXStatus status) throws APEXParsingException
originator
- Originator endpoint addressrecipient
- Receipient endpoint addresscontent
- Byte content for this messagecontentType
- the content type or null
for nonetransferEncoding
- the encoding of the byte contentstatus
- A status listener or null
APEXParsingException
- Thrown if the creation if the MIME Multipart failspublic int sendMessage(APEXEndpointAddress originator, HashSet recipients, byte[] content, String contentType, String transferEncoding, APEXStatus status) throws APEXParsingException
originator
- Originator endpoint addressrecipients
- A set of receipient endpoint addressescontent
- Byte content for this messagecontentType
- the content type or null
for nonetransferEncoding
- the encoding of the byte contentstatus
- A status listener or null
APEXParsingException
- Thrown if the creation if the MIME Multipart failspublic int sendMessage(APEXDataMessage message, APEXStatus status)
Sends an APEXDataMessage
to the recipients specified
within the object.
message
- The message to be sentstatus
- A status listener or null
public int sendAPEXDataMessage(APEXDataMessage message)
Sends an APEXDataMessage
to the recipients specified
within the object.
sendAPEXDataMessage
in class APEXManager
message
- Data message to be sent. If no recipients are specified,
no action is taken.
public int terminate(APEXTerminateMessage atm, Object receivingChannelID)
terminate
element is received a status
code (for the reply is returned). This method terminates the transaction
if it exists
terminate
in class APEXManager
atm
- Associated APEXTerminateMessage
for operation
to terminate.receivingChannelID
- A channel identifier for the channel which received the
operation
public void handleIncomingMessage(APEXMessage message, Object receivingChannelID) throws APEXException
handleIncomingMessage
' method. attachEndpoint
'
methodterminate
'
methodprocessData
' method
handleIncomingMessage
in class APEXManager
message
- The incoming messagereceivingChannelID
- The channel identifier of the channel which received the
message
APEXException
- Is thrown on an error in processingpublic void messageDiscarded(APEXDataMessage m, int code, String reason)
This mesthod is called when a connection wasn't able to send
an 'APEXDataMessage
', say a
(where x != 250) is received or the next hop is not responding.
All applicable services are called by there method
'handleDiscarded
'.
Note: In an APEXEndpointAddress
, no messages can be
discarded, since there is no relaying
messageDiscarded
in class APEXManager
m
- The message which wasn't sentcode
- The error code of this messagereason
- A textual reasonpublic void messageSent(APEXDataMessage m, APEXReply reply)
APEXDataMessage
' is
successfully sent on a connection, say an
element has been received. All applicable services are called
by their method 'handleSent
'
Note: In an APEXEndpointAddress
, no messages
relayed, thus, this method is not used.
messageSent
in class APEXManager
m
- The message which has successfully sentreply
- The reply object received of the next hop
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |