/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.remoting.transport;

/**
 * MBean interface.
 * @todo I think exposing the ServerInvoker directly might be wise, so it could have configuration
 */
public interface ConnectorMBean {

   /**
    * Starts the connector.
    */
  void start() throws java.lang.Exception;

   /**
    * Stops the connector.
    */
  void stop() ;

   /**
    * Creates the connector.
    */
  void create() throws java.lang.Exception;

   /**
    * Destroys the connector.
    */
  void destroy() ;

   /**
    * Returns the locator to the connector. Locator is the actual InvokerLocator object used to identify and get the ServerInvoker we are wrapping.
    */
  org.jboss.remoting.InvokerLocator getLocator() ;

   /**
    * Sets the invoker locator. InvokerLocator is the string URI representation of the InvokerLocator used to get and identify the ServerInvoker we are wrapping.
    */
  void setInvokerLocator(java.lang.String locator) 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.
    */
  java.lang.String getInvokerLocator() 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.
    */
  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.
    */
  org.w3c.dom.Element getConfiguration() ;

   /**
    * Adds an invocation handler for the named subsystem to the invoker we manage, and sets the mbean server on the invocation handler.
    * @todo why don't we just make all the invocation handlers mbeans, so they already know what mbean server they use?
    */
  void addInvocationHandler(java.lang.String subsystem,org.jboss.remoting.ServerInvocationHandler handler) throws java.lang.Exception;

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

}
