public interface Gateway
All gateways to external event systems (for exanoke, SMS, IM, JMS) must implement this interface.
Modifier and Type | Field and Description |
---|---|
static int |
FAILED
Indicates that the gateway has failed.
|
static int |
RUNNING
Indicates that the gateway is running.
|
static int |
STARTING
Indicates that the gateway is starting.
|
static int |
STOPPED
Indicates that the gateway has stopped.
|
static int |
STOPPING
Indicates that the gateway is stopping.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getGatewayID()
Return the ID that uniquely defines the gateway instance.
|
GatewayHelper |
getHelper()
Return a gateway helper class (if any) so that a CFC can invoke
gateway-specific utility functions that might be useful
to the CFML developer.
|
int |
getStatus()
Return the status of the gateway.
|
java.lang.String |
outgoingMessage(CFEvent cfmsg)
Send a message from the gateway to the resource.
|
void |
restart()
Restart this gateway.
|
void |
setCFCListeners(java.lang.String[] listeners)
Set the CFClisteners list.
|
void |
setGatewayID(java.lang.String id)
Set the ID that uniquely defines the gateway instance.
|
void |
start()
Start this gateway.
|
void |
stop()
Stop this gateway.
|
static final int STARTING
getStatus()
,
Constant Field Valuesstatic final int RUNNING
getStatus()
,
Constant Field Valuesstatic final int STOPPING
getStatus()
,
Constant Field Valuesstatic final int STOPPED
getStatus()
,
Constant Field Valuesstatic final int FAILED
getStatus()
,
Constant Field Valuesvoid setGatewayID(java.lang.String id)
Generally, you just need to return this string in getGatewayID(). It is used by the event manager to identify the gateway.
id
- The gateway id string.java.lang.String getGatewayID()
java.lang.String outgoingMessage(CFEvent cfmsg)
The message to send and related information is located in the Map returned by the CFEvent getData() method. The values in the Map are gateway-specific; the CFML sending the output message must put the information the gateway requires in the Map.
cfmsg
- the CFEvent object containing the message to sendvoid setCFCListeners(java.lang.String[] listeners)
Takes an array of fully qualified ColdFusion component paths (for example, c:/path/to/my/template.cfc) each of which should each receive events from the gateway. This method resets the list each time it is called.
This method is called by the Event Service manager on startup, and may be called if the configuration of the gateway is changed during operation.
listeners
- An array of filesystem paths to ColdFusion components.GatewayHelper getHelper()
Called by the CFML function getGatewayHelper(gatewayID).
Return null if you do not provide a helper class.
void start()
Perform any required gateway-specific initialization. The method starts up any listener threads that monitor the event source for the gateway.
This function should return within a time-out period that is specified in the ColdFusion MX Administrator. There is also an Administrator option that determines whether the thread that calls this function gets killed if the function does not return within the time-out period.
restart
,
stop
,
Gateway in Livedocsvoid stop()
Perform any gateway-specific shutdown tasks, such as shutting down listener threads or releasing resources.
start
,
restart
,
Gateway in Livedocsvoid restart()
Generally, this method can be implemented as a call to stop() and then start(), but you may be able to optimize this method, depending on the service tht the gateway communicates with.
start
,
stop
,
Gateway in Livedocsint getStatus()