Interface Gateway
- All Known Implementing Classes:
GenericGateway
All gateways to external event systems (for exanoke, SMS, IM, JMS) must implement this interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates that the gateway has failed.static final intIndicates that the gateway is running.static final intIndicates that the gateway is starting.static final intIndicates that the gateway has stopped.static final intIndicates that the gateway is stopping. -
Method Summary
Modifier and TypeMethodDescriptionReturn the ID that uniquely defines the gateway instance.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.intReturn the status of the gateway.outgoingMessage(CFEvent cfmsg) Send a message from the gateway to the resource.voidrestart()Restart this gateway.voidsetCFCListeners(String[] listeners) Set the CFClisteners list.voidsetGatewayID(String id) Set the ID that uniquely defines the gateway instance.voidstart()Start this gateway.voidstop()Stop this gateway.
-
Field Details
-
STARTING
static final int STARTINGIndicates that the gateway is starting.- See Also:
-
RUNNING
static final int RUNNINGIndicates that the gateway is running.- See Also:
-
STOPPING
static final int STOPPINGIndicates that the gateway is stopping.- See Also:
-
STOPPED
static final int STOPPEDIndicates that the gateway has stopped.- See Also:
-
FAILED
static final int FAILEDIndicates that the gateway has failed.- See Also:
-
-
Method Details
-
setGatewayID
Set the ID that uniquely defines the gateway instance.Generally, you just need to return this string in getGatewayID(). It is used by the event manager to identify the gateway.
- Parameters:
id- The gateway id string.- See Also:
-
getGatewayID
String getGatewayID()Return the ID that uniquely defines the gateway instance.- Returns:
- The gateway ID set by setGatewayID().
-
outgoingMessage
Send a message from the gateway to the resource.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.
- Parameters:
cfmsg- the CFEvent object containing the message to send- Returns:
- A gateway-specific string, such as an outgoing message ID or status.
- See Also:
-
setCFCListeners
Set the CFClisteners list.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.
- Parameters:
listeners- An array of filesystem paths to ColdFusion components.- See Also:
-
getHelper
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. The helper class must implement the GatewayHelper marker interface.Called by the CFML function getGatewayHelper(gatewayID).
Return null if you do not provide a helper class.
- Returns:
- An instance of the gateway-specific helper class, or null.
- See Also:
-
start
void start()Start this gateway.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.
- See Also:
-
stop
void stop()Stop this gateway.Perform any gateway-specific shutdown tasks, such as shutting down listener threads or releasing resources.
- See Also:
-
restart
void restart()Restart this gateway.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.
- See Also:
-
getStatus
int getStatus()Return the status of the gateway.- Returns:
- One of STARTING, RUNNING, STOPPING, STOPPED, FAILED.
-