org.mule.providers.stream
Class SystemStreamConnector

java.lang.Object
  extended by org.mule.providers.AbstractConnector
      extended by org.mule.providers.stream.StreamConnector
          extended by org.mule.providers.stream.SystemStreamConnector
All Implemented Interfaces:
ExceptionListener, EventListener, javax.resource.spi.work.WorkListener, Disposable, Initialisable, UMOConnectable, UMOConnector

public class SystemStreamConnector
extends StreamConnector

SystemStreamConnector connects to the System streams in and out by default and add some basic fuctionality for writing out prompt messages.


Field Summary
 
Fields inherited from class org.mule.providers.stream.StreamConnector
inputStream, outputStream, STREAM_SYSTEM_ERR, STREAM_SYSTEM_IN, STREAM_SYSTEM_OUT
 
Fields inherited from class org.mule.providers.AbstractConnector
connected, connecting, connectionStrategy, createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, defaultInboundTransformer, defaultOutboundTransformer, defaultResponseTransformer, dispatcherFactory, dispatchers, disposed, disposing, exceptionListener, initialised, logger, name, numberOfConcurrentTransactedReceivers, receivers, serviceDescriptor, serviceOverrides, sessionHandler, started, startOnConnect
 
Fields inherited from interface org.mule.umo.provider.UMOConnector
INT_VALUE_NOT_SET
 
Constructor Summary
SystemStreamConnector()
           
 
Method Summary
protected  void doConnect()
          Template method where any connections should be made for the connector
protected  void doDisconnect()
          Template method where any connected resources used by the connector should be disconnected
protected  void doDispose()
          Template method to perform any work when destroying the connectoe
protected  void doInitialise()
           
 void doStart()
          Template method to perform any work when starting the connectoe
 UMOConnector getConnector()
           
 InputStream getInputStream()
           
 long getMessageDelayTime()
           
 String getOutputMessage()
           
 String getOutputMessageCode()
           
 OutputStream getOutputStream()
           
 OutputStream getOutputStream(UMOImmutableEndpoint endpoint, UMOMessage message)
          Will get the output stream for this type of transport.
 String getPromptMessage()
           
 String getPromptMessageCode()
           
 String getResourceBundle()
           
 UMOMessageReceiver registerListener(UMOComponent component, UMOEndpoint endpoint)
          This creates a UMOMessageReceiver associated with this endpoint and registers it with the connector.
 void setMessageDelayTime(long messageDelayTime)
           
 void setOutputMessage(String outputMessage)
           
 void setOutputMessageCode(String outputMessageCode)
           
 void setPromptMessage(String promptMessage)
           
 void setPromptMessageCode(String promptMessageCode)
           
 void setResourceBundle(String resourceBundle)
           
 
Methods inherited from class org.mule.providers.stream.StreamConnector
createReceiver, doStop, getProtocol, setInputStream, setOutputStream
 
Methods inherited from class org.mule.providers.AbstractConnector
checkDisposed, connect, destroyReceiver, disconnect, dispatch, dispose, disposeDispatchers, disposeReceivers, disposeWorkManagers, exceptionThrown, fireNotification, getConnectEventId, getConnectionDescription, getConnectionStrategy, getDefaultInboundTransformer, getDefaultOutboundTransformer, getDefaultResponseTransformer, getDispatcherFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getExceptionListener, getMaxDispatchersActive, getMessageAdapter, getName, getNumberOfConcurrentTransactedReceivers, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getStreamMessageAdapter, getSupportedProtocols, handleException, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, isConnected, isCreateMultipleTransactedReceivers, isDisposed, isDisposing, isEnableMessageEvents, isRemoteSyncEnabled, isStarted, lookupReceiver, receive, receive, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, send, setConnectionStrategy, setCreateMultipleTransactedReceivers, setDefaultInboundTransformer, setDefaultOutboundTransformer, setDefaultResponseTransformer, setDispatcherFactory, setDispatcherThreadingProfile, setEnableMessageEvents, setExceptionListener, setMaxDispatchersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setServiceOverrides, setSessionHandler, setSupportedProtocols, startConnector, stopConnector, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, workAccepted, workCompleted, workRejected, workStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SystemStreamConnector

public SystemStreamConnector()
Method Detail

doInitialise

protected void doInitialise()
                     throws InitialisationException
Specified by:
doInitialise in class AbstractConnector
Throws:
InitialisationException

doDispose

protected void doDispose()
Description copied from class: AbstractConnector
Template method to perform any work when destroying the connectoe

Overrides:
doDispose in class StreamConnector

doConnect

protected void doConnect()
                  throws Exception
Description copied from class: AbstractConnector
Template method where any connections should be made for the connector

Specified by:
doConnect in class AbstractConnector
Throws:
Exception

doDisconnect

protected void doDisconnect()
                     throws Exception
Description copied from class: AbstractConnector
Template method where any connected resources used by the connector should be disconnected

Specified by:
doDisconnect in class AbstractConnector
Throws:
Exception

getInputStream

public InputStream getInputStream()
Overrides:
getInputStream in class StreamConnector

doStart

public void doStart()
Description copied from class: AbstractConnector
Template method to perform any work when starting the connectoe

Overrides:
doStart in class StreamConnector

getOutputStream

public OutputStream getOutputStream()
Overrides:
getOutputStream in class StreamConnector

getPromptMessage

public String getPromptMessage()
Returns:
Returns the promptMessage.

setPromptMessage

public void setPromptMessage(String promptMessage)
Parameters:
promptMessage - The promptMessage to set.

getPromptMessageCode

public String getPromptMessageCode()
Returns:
Returns the promptMessageCode.

setPromptMessageCode

public void setPromptMessageCode(String promptMessageCode)
Parameters:
promptMessageCode - The promptMessageCode to set.

getResourceBundle

public String getResourceBundle()
Returns:
Returns the resourceBundle.

setResourceBundle

public void setResourceBundle(String resourceBundle)
Parameters:
resourceBundle - The resourceBundle to read the message from. This property is only needed in conjunction with promptMessageCode or outputMessageCode.

getOutputMessage

public String getOutputMessage()
Returns:
Returns the outputMessage.

setOutputMessage

public void setOutputMessage(String outputMessage)
Parameters:
outputMessage - The outputMessage to set.

getOutputMessageCode

public String getOutputMessageCode()
Returns:
Returns the outputMessageCode.

setOutputMessageCode

public void setOutputMessageCode(String outputMessageCode)
Parameters:
outputMessageCode - The outputMessageCode to set.

getConnector

public UMOConnector getConnector()

registerListener

public UMOMessageReceiver registerListener(UMOComponent component,
                                           UMOEndpoint endpoint)
                                    throws Exception
Description copied from class: AbstractConnector
This creates a UMOMessageReceiver associated with this endpoint and registers it with the connector.

Specified by:
registerListener in interface UMOConnector
Overrides:
registerListener in class AbstractConnector
Parameters:
component - the listening component
endpoint - the endpoint contains the listener endpointUri on which to listen on.
Returns:
message receiver
Throws:
Exception - if the UMOMessageReceiver cannot be created or the Receiver cannot be registered

getMessageDelayTime

public long getMessageDelayTime()

setMessageDelayTime

public void setMessageDelayTime(long messageDelayTime)

getOutputStream

public OutputStream getOutputStream(UMOImmutableEndpoint endpoint,
                                    UMOMessage message)
                             throws UMOException
Description copied from class: AbstractConnector
Will get the output stream for this type of transport. Typically this will be called only when Streaming is being used on an outbound endpoint. If Streaming is not supported by this transport an UnsupportedOperationException is thrown. Note that the stream MUST release resources on close. For help doing so, see CallbackOutputStream.

Specified by:
getOutputStream in interface UMOConnector
Overrides:
getOutputStream in class AbstractConnector
Parameters:
endpoint - the endpoint that releates to this Dispatcher
message - the current message being processed
Returns:
the output stream to use for this request
Throws:
UMOException - in case of any error


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.