com.createtank.elemenope.transports
Class DirectCallConnector

java.lang.Object
  extended by com.createtank.elemenope.transports.DirectCallConnector
All Implemented Interfaces:
Connector, ElemenopeComponent, ElemenopeConnectionEntity

public class DirectCallConnector
extends java.lang.Object
implements Connector

Blocking Call implementation of the elemenope Connector interface

For an example configuration, see direct.xml

Author:
John Joseph Roets [joe@createtank.com]

Constructor Summary
DirectCallConnector()
          Creates a new instance of DirectCallConnector
 
Method Summary
 void connect()
          makes initial connection to entity
 void disconnect()
          closes connection to entity
 java.lang.Object executeBlockingCall(java.lang.String operationType, java.lang.Object object)
          Blocking call implementation specific method to allow dispatcher to send message.
 java.lang.Object getConnection()
          Get connection implementation specific object.
 java.util.Map getConnectionAttributes()
          sets connectivity attributes
 boolean isActive()
          May be used by DispatcherFailover [DFO] implementations to ascertain whether a connection is currently viable.
 void releaseComponents()
          Should be called upon shutdown, in order for elemenope component classes clean up after themselves.
 void setBroker(Broker broker)
           
 void setComponents(ElemenopeComponents components)
          Passes all configured components to implementing Object.
 void setConfigurationAttributes(java.util.Map atts)
          sets configuration attributes
 void setConnectionAttributes(java.util.Map atts)
          sets connectivity attributes
 void start()
          starts the connection to entity
 void stop()
          stops the connection to entity
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectCallConnector

public DirectCallConnector()
Creates a new instance of DirectCallConnector

Method Detail

setComponents

public void setComponents(ElemenopeComponents components)
Description copied from interface: ElemenopeComponent
Passes all configured components to implementing Object.

Should ususally be called at the end of the initialization cycle, when all components have been instantiated.

Specified by:
setComponents in interface ElemenopeComponent

releaseComponents

public void releaseComponents()
Description copied from interface: ElemenopeComponent
Should be called upon shutdown, in order for elemenope component classes clean up after themselves.

Specified by:
releaseComponents in interface ElemenopeComponent

connect

public void connect()
             throws ElemenopeConnectionException
makes initial connection to entity

Specified by:
connect in interface Connector
Throws:
java.lang.Exception - Exception thrown when problems occur connecting.
ElemenopeConnectionException

disconnect

public void disconnect()
                throws ElemenopeConnectionException
closes connection to entity

Specified by:
disconnect in interface Connector
Throws:
java.lang.Exception - Exception thrown when problems occur connecting.
ElemenopeConnectionException

getConnection

public java.lang.Object getConnection()
                               throws ElemenopeException
Description copied from interface: Connector
Get connection implementation specific object.

Used by some implementations to pass connection for use by Broker or Dispatcher.

Specified by:
getConnection in interface Connector
Returns:
connection implementation specific object.
Throws:
ElemenopeException

getConnectionAttributes

public java.util.Map getConnectionAttributes()
                                      throws ElemenopeException
sets connectivity attributes

Specified by:
getConnectionAttributes in interface ElemenopeConnectionEntity
Parameters:
atts - Map of connectivity attributes
Returns:
connectivity attributes
Throws:
java.lang.Exception - exception
ElemenopeException

setConnectionAttributes

public void setConnectionAttributes(java.util.Map atts)
                             throws ElemenopeException
sets connectivity attributes

Specified by:
setConnectionAttributes in interface ElemenopeConnectionEntity
Parameters:
atts - Map of connectivity attributes
Throws:
java.lang.Exception - exception
ElemenopeException

executeBlockingCall

public java.lang.Object executeBlockingCall(java.lang.String operationType,
                                            java.lang.Object object)
                                     throws ElemenopeException
Blocking call implementation specific method to allow dispatcher to send message.

Parameters:
operationType -
object -
Returns:
Throws:
ElemenopeException

setBroker

public void setBroker(Broker broker)
Parameters:
broker -

start

public void start()
Description copied from interface: Connector
starts the connection to entity

Specified by:
start in interface Connector

stop

public void stop()
Description copied from interface: Connector
stops the connection to entity

Specified by:
stop in interface Connector

isActive

public boolean isActive()
Description copied from interface: Connector
May be used by DispatcherFailover [DFO] implementations to ascertain whether a connection is currently viable.

Specified by:
isActive in interface Connector
Returns:
Is connection active?

setConfigurationAttributes

public void setConfigurationAttributes(java.util.Map atts)
                                throws ElemenopeException
Description copied from interface: ElemenopeComponent
sets configuration attributes

Specified by:
setConfigurationAttributes in interface ElemenopeComponent
Parameters:
atts - Map of connectivity attributes
Throws:
ElemenopeException