2
* JBoss, Home of Professional Open Source
3
* Copyright 2005, JBoss Inc., and individual contributors as indicated
4
* by the @authors tag. See the copyright.txt in the distribution for a
5
* full listing of individual contributors.
7
* This is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU Lesser General Public License as
9
* published by the Free Software Foundation; either version 2.1 of
10
* the License, or (at your option) any later version.
12
* This software is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this software; if not, write to the Free
19
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
23
package org.jboss.remoting.transport;
25
import org.jboss.remoting.ConnectionListener;
30
public interface ConnectorMBean
34
* Starts the connector.
36
void start() throws java.lang.Exception;
39
* Starts the connector.
41
* @param runAsNewThread indicates if should be started on new thread or the current one
42
* @throws java.lang.Exception
44
void start(boolean runAsNewThread) throws java.lang.Exception;
47
* Stops the connector.
52
* Creates the connector.
54
void create() throws java.lang.Exception;
57
* Destroys the connector.
62
* Returns the locator to the connector. Locator is the actual InvokerLocator object used to identify and get the ServerInvoker we are wrapping.
64
org.jboss.remoting.InvokerLocator getLocator();
67
* Sets the invoker locator. InvokerLocator is the string URI representation of the InvokerLocator used to get and identify the ServerInvoker we are wrapping.
69
void setInvokerLocator(java.lang.String locator) throws java.lang.Exception;
72
* Returns the invoker locator. InvokerLocator is the string URI representation of the InvokerLocator used to get and identify the ServerInvoker we are wrapping.
74
java.lang.String getInvokerLocator() throws java.lang.Exception;
77
* Configuration is an xml element indicating subsystems to be registered with the ServerInvoker we wrap. Using mbean subsystems that call registerSubsystem is more flexible.
79
void setConfiguration(org.w3c.dom.Element xml) throws java.lang.Exception;
82
* Configuration is an xml element indicating subsystems to be registered with the ServerInvoker we wrap. Using mbean subsystems that call registerSubsystem is more flexible.
84
org.w3c.dom.Element getConfiguration();
87
* 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).
90
* @param handlerObjectName
91
* @return The previous ServerInvocationHandler with the same subsystem value (case insensitive), if one existed. Otherwise will return null.
94
org.jboss.remoting.ServerInvocationHandler addInvocationHandler(java.lang.String subsystem, javax.management.ObjectName handlerObjectName) throws java.lang.Exception;
97
* Adds an invocation handler for the named subsystem to the invoker we manage, and sets the mbean server on the invocation handler.
98
* Will return previous ServerInvocationHandler with same subsystem value (case insensitive), if one existed. Otherwise will return null.
100
org.jboss.remoting.ServerInvocationHandler addInvocationHandler(java.lang.String subsystem, org.jboss.remoting.ServerInvocationHandler handler) throws java.lang.Exception;
103
* Removes an invocation handler for the supplied subsystem from the invoker we manage, and unsets the MBeanServer on the handler.
105
void removeInvocationHandler(java.lang.String subsystem) throws java.lang.Exception;
108
* Adds a connection listener to receive notification when a client connection
109
* is lost or disconnected. Will only be triggered for notifications when
110
* leasing is turned on (via the lease period attribute being set to > 0).
113
* @jmx.managed-operation description = "Add a connection listener to call when detect that a client has
114
* failed or disconnected."
116
* @jmx.managed-parameter name = "listener"
117
* type = "org.jboss.remoting.ConnectionListener"
118
* description = "The connection listener to register"
120
void addConnectionListener(ConnectionListener listener);
123
* Removes connection listener from receiving client connection lost/disconnected
127
* @jmx.managed-operation description = "Remove a client connection listener."
129
* @jmx.managed-parameter name = "listener"
130
* type = "org.jboss.remoting.ConnectionListener"
131
* description = "The client connection listener to remove."
133
void removeConnectionListener(ConnectionListener listener);
136
* Sets the lease period for client connections.
137
* Value is in milliseconds.
138
* @param leasePeriodValue
140
* @jmx.managed-attribute description = "The number of milliseconds that should be used
141
* when establishing the client lease period (meaning client will need to update its lease
142
* within this amount of time or will be considered dead)."
143
* access = "read-write"
145
void setLeasePeriod(long leasePeriodValue);
148
* Gets the lease period for client connections.
149
* Value in milliseconds.
152
* @jmx.managed-attribute
154
long getLeasePeriod();