org.jboss.remoting.transport
Class Connector

java.lang.Object
  extended byorg.jboss.remoting.transport.Connector
All Implemented Interfaces:
ConnectorMBean (src) , MBeanRegistration (src)
Direct Known Subclasses:
MarshallLoaderConnector (src)

public class Connector
extends java.lang.Object
implements MBeanRegistration (src) , ConnectorMBean (src)

Connector is an implementation of the ConnectorMBean interface. The Connector is root component for the remoting server. It binds the server transport, marshaller, and handler together to form the remoting server instance. A transport connector is configured via *-service.xml such as: 1 303 304 60000 ${jboss.bind.address} 6666 false 200 org.jboss.remoting.transport.mock.MockServerInvocationHandler 2410


Field Summary
protected  ServerInvoker (src) invoker
           
protected  Logger (src) log
           
 
Constructor Summary
  Connector()
           
protected Connector(boolean isMarshallerConnector)
           
 
Method Summary
 void addInvocationHandler(java.lang.String subsystem, ObjectName (src)  handlerObjectName)
          Adds a handler to the connector via OjbectName.
 void addInvocationHandler(java.lang.String subsystem, ServerInvocationHandler (src)  handler)
          Adds an invocation handler for the named subsystem to the invoker we manage, and sets the mbean server on the invocation handler.
 void create()
          Creates the connector.
 void destroy()
          Destroys the connector.
 org.w3c.dom.Element getConfiguration()
          Configuration is an xml element indicating subsystems to be registered with the ServerInvoker we wrap.
 java.lang.String getInvokerLocator()
          Returns the invoker locator.
 InvokerLocator (src) getLocator()
          Returns the locator to the connector.
 boolean isStarted()
           
 void postDeregister()
          This method is called by the MBeanServer after deregistration takes place.
 void postRegister(java.lang.Boolean registrationDone)
          This method is called by the MBeanServer after registration takes place or when registration fails.
 void preDeregister()
          This method is called by the MBeanServer before deregistration takes place.
 ObjectName (src) preRegister(MBeanServer (src)  server, ObjectName (src)  name)
          This method is called by the MBeanServer before registration takes place.
 void removeInvocationHandler(java.lang.String subsystem)
          Removes an invocation handler for the supplied subsystem from the invoker we manage, and unsets the MBeanServer on the handler.
 void setConfiguration(org.w3c.dom.Element xml)
          Configuration is an xml element indicating subsystems to be registered with the ServerInvoker we wrap.
 void setInvokerLocator(java.lang.String locator)
          Sets the invoker locator.
 void start()
          Starts the connector.
 void stop()
          Stops the connector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

invoker

protected ServerInvoker (src)  invoker

log

protected final Logger (src)  log
Constructor Detail

Connector

public Connector()

Connector

protected Connector(boolean isMarshallerConnector)
Method Detail

isStarted

public boolean isStarted()

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  server,
                              ObjectName (src)  name)
                       throws java.lang.Exception
This method is called by the MBeanServer before registration takes place. The MBean is passed a reference of the MBeanServer it is about to be registered with. The MBean must return the ObjectName it will be registered with. The MBeanServer can pass a suggested object depending upon how the MBean is registered.

The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preRegister in interface MBeanRegistration (src)
Parameters:
server - the MBeanServer the MBean is about to be registered with.
name - the suggested ObjectName supplied by the MBeanServer.
Returns:
the actual ObjectName to register this MBean with.
Throws:
java.lang.Exception - for any error, the MBean is not registered.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
This method is called by the MBeanServer after registration takes place or when registration fails.

Specified by:
postRegister in interface MBeanRegistration (src)
Parameters:
registrationDone - the MBeanServer passes true when the MBean was registered, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
This method is called by the MBeanServer before deregistration takes place.

The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preDeregister in interface MBeanRegistration (src)
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
This method is called by the MBeanServer after deregistration takes place.

Specified by:
postDeregister in interface MBeanRegistration (src)

start

public void start()
           throws java.lang.Exception
Starts the connector.

Specified by:
start in interface ConnectorMBean (src)
Throws:
java.lang.Exception

stop

public void stop()
Stops the connector.

Specified by:
stop in interface ConnectorMBean (src)

create

public void create()
            throws java.lang.Exception
Creates the connector.

Specified by:
create in interface ConnectorMBean (src)
Throws:
java.lang.Exception

destroy

public void destroy()
Destroys the connector.

Specified by:
destroy in interface ConnectorMBean (src)

getLocator

public InvokerLocator (src)  getLocator()
Returns the locator to the connector. Locator is the actual InvokerLocator object used to identify and get the ServerInvoker we are wrapping.

Specified by:
getLocator in interface ConnectorMBean (src)

setInvokerLocator

public void setInvokerLocator(java.lang.String locator)
                       throws java.lang.Exception
Sets the invoker locator. InvokerLocator is the string URI representation of the InvokerLocator used to get and identify the ServerInvoker we are wrapping.

Specified by:
setInvokerLocator in interface ConnectorMBean (src)
Throws:
java.lang.Exception

getInvokerLocator

public java.lang.String getInvokerLocator()
                                   throws java.lang.Exception
Returns the invoker locator. InvokerLocator is the string URI representation of the InvokerLocator used to get and identify the ServerInvoker we are wrapping.

Specified by:
getInvokerLocator in interface ConnectorMBean (src)
Throws:
java.lang.Exception

setConfiguration

public void setConfiguration(org.w3c.dom.Element xml)
                      throws java.lang.Exception
Configuration is an xml element indicating subsystems to be registered with the ServerInvoker we wrap. Using mbean subsystems that call registerSubsystem is more flexible.

Specified by:
setConfiguration in interface ConnectorMBean (src)
Throws:
java.lang.Exception

getConfiguration

public org.w3c.dom.Element getConfiguration()
Configuration is an xml element indicating subsystems to be registered with the ServerInvoker we wrap. Using mbean subsystems that call registerSubsystem is more flexible.

Specified by:
getConfiguration in interface ConnectorMBean (src)

addInvocationHandler

public void addInvocationHandler(java.lang.String subsystem,
                                 ObjectName (src)  handlerObjectName)
                          throws java.lang.Exception
Adds a handler to the connector via OjbectName. This will create a mbean proxy of type of ServerInvocationHandler for the MBean specified by object name passed (so has to implement ServerInvocationHandler interface).

Specified by:
addInvocationHandler in interface ConnectorMBean (src)
Parameters:
subsystem -
handlerObjectName -
Throws:
java.lang.Exception

addInvocationHandler

public void addInvocationHandler(java.lang.String subsystem,
                                 ServerInvocationHandler (src)  handler)
                          throws java.lang.Exception
Adds an invocation handler for the named subsystem to the invoker we manage, and sets the mbean server on the invocation handler.

Specified by:
addInvocationHandler in interface ConnectorMBean (src)
Throws:
java.lang.Exception

removeInvocationHandler

public void removeInvocationHandler(java.lang.String subsystem)
                             throws java.lang.Exception
Removes an invocation handler for the supplied subsystem from the invoker we manage, and unsets the MBeanServer on the handler.

Specified by:
removeInvocationHandler in interface ConnectorMBean (src)
Throws:
java.lang.Exception