org.jboss.invocation.http.server
Class HttpProxyFactory

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.invocation.http.server.HttpProxyFactory
All Implemented Interfaces:
HttpProxyFactoryMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)
Direct Known Subclasses:
HttpProxyFactoryHA (src)

public class HttpProxyFactory
extends ServiceMBeanSupport (src)
implements HttpProxyFactoryMBean (src)

Create an interface proxy that uses HTTP to communicate with the server side object that exposes the corresponding JMX invoke operation. Any request to this servlet receives a serialized object stream containing a MarshalledValue with the Naming proxy as its content.


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
HttpProxyFactory()
           
 
Method Summary
protected  void checkInvokerURL()
          Validate that the invokerURL is set, and if not build it from the invokerURLPrefix + host + invokerURLSuffix.
protected  Invoker (src) createInvoker()
          Create the Invoker
protected  java.util.ArrayList defineDefaultInterceptors()
          Build the default interceptor list.
 org.w3c.dom.Element getClientInterceptors()
           
 java.lang.Class getExportedInterface()
          Get the RMI compatible interface that the HttpInvokerProxy implements
 ObjectName (src) getInvokerName()
          Get the server side mbean that exposes the invoke operation for the exported interface
 java.lang.String getInvokerURL()
          Get the http URL to the InvokerServlet
 java.lang.String getInvokerURLPrefix()
          If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix.
 java.lang.String getInvokerURLSuffix()
          If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix.
 java.lang.String getJndiName()
          Get the JNDI name under which the HttpInvokerProxy will be bound
 java.lang.Object getProxy()
          Get the proxy instance created by the factory.
 java.lang.Object getProxy(java.lang.Object id)
          Create a new proxy instance with the given id, no jndi name and all other settings the same as the jndi bound proxy.
 boolean getUseHostName()
          A flag if the InetAddress.getHostName() or getHostAddress() method should be used as the host component of invokerURLPrefix + host + invokerURLSuffix.
 void setClientInterceptors(org.w3c.dom.Element config)
           
 void setExportedInterface(java.lang.Class exportedInterface)
          Set the RMI compatible interface that the HttpInvokerProxy implements
 void setInvokerName(ObjectName (src)  jmxInvokerName)
          Set the server side mbean that exposes the invoke operation for the exported interface
 void setInvokerURL(java.lang.String invokerURL)
          Set the http URL to the InvokerServlet
 void setInvokerURLPrefix(java.lang.String invokerURLPrefix)
          If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix.
 void setInvokerURLSuffix(java.lang.String invokerURLSuffix)
          If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix.
 void setJndiName(java.lang.String jndiName)
          Set the JNDI name under which the HttpInvokerProxy will be bound
 void setUseHostName(boolean flag)
          A flag if the InetAddress.getHostName() or getHostAddress() method should be used as the host component of invokerURLPrefix + host + invokerURLSuffix.
protected  void startService()
          Initializes the servlet.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Constructor Detail

HttpProxyFactory

public HttpProxyFactory()
Method Detail

getInvokerName

public ObjectName (src)  getInvokerName()
Description copied from interface: HttpProxyFactoryMBean (src)
Get the server side mbean that exposes the invoke operation for the exported interface

Specified by:
getInvokerName in interface HttpProxyFactoryMBean (src)

setInvokerName

public void setInvokerName(ObjectName (src)  jmxInvokerName)
Description copied from interface: HttpProxyFactoryMBean (src)
Set the server side mbean that exposes the invoke operation for the exported interface

Specified by:
setInvokerName in interface HttpProxyFactoryMBean (src)

getJndiName

public java.lang.String getJndiName()
Description copied from interface: HttpProxyFactoryMBean (src)
Get the JNDI name under which the HttpInvokerProxy will be bound

Specified by:
getJndiName in interface HttpProxyFactoryMBean (src)

setJndiName

public void setJndiName(java.lang.String jndiName)
Description copied from interface: HttpProxyFactoryMBean (src)
Set the JNDI name under which the HttpInvokerProxy will be bound

Specified by:
setJndiName in interface HttpProxyFactoryMBean (src)

getInvokerURL

public java.lang.String getInvokerURL()
Description copied from interface: HttpProxyFactoryMBean (src)
Get the http URL to the InvokerServlet

Specified by:
getInvokerURL in interface HttpProxyFactoryMBean (src)

setInvokerURL

public void setInvokerURL(java.lang.String invokerURL)
Description copied from interface: HttpProxyFactoryMBean (src)
Set the http URL to the InvokerServlet

Specified by:
setInvokerURL in interface HttpProxyFactoryMBean (src)

getInvokerURLPrefix

public java.lang.String getInvokerURLPrefix()
Description copied from interface: HttpProxyFactoryMBean (src)
If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix.

Specified by:
getInvokerURLPrefix in interface HttpProxyFactoryMBean (src)

setInvokerURLPrefix

public void setInvokerURLPrefix(java.lang.String invokerURLPrefix)
Description copied from interface: HttpProxyFactoryMBean (src)
If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix. An example prefix is "http://", and this is the default value.

Specified by:
setInvokerURLPrefix in interface HttpProxyFactoryMBean (src)

getInvokerURLSuffix

public java.lang.String getInvokerURLSuffix()
Description copied from interface: HttpProxyFactoryMBean (src)
If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix.

Specified by:
getInvokerURLSuffix in interface HttpProxyFactoryMBean (src)

setInvokerURLSuffix

public void setInvokerURLSuffix(java.lang.String invokerURLSuffix)
Description copied from interface: HttpProxyFactoryMBean (src)
If there is no invokerURL set, then one will be constructed via the concatenation of invokerURLPrefix + the local host + invokerURLSuffix. An example suffix is "/invoker/JMXInvokerServlet" and this is the default value.

Specified by:
setInvokerURLSuffix in interface HttpProxyFactoryMBean (src)

getUseHostName

public boolean getUseHostName()
Description copied from interface: HttpProxyFactoryMBean (src)
A flag if the InetAddress.getHostName() or getHostAddress() method should be used as the host component of invokerURLPrefix + host + invokerURLSuffix. If true getHostName() is used, false getHostAddress().

Specified by:
getUseHostName in interface HttpProxyFactoryMBean (src)

setUseHostName

public void setUseHostName(boolean flag)
Description copied from interface: HttpProxyFactoryMBean (src)
A flag if the InetAddress.getHostName() or getHostAddress() method should be used as the host component of invokerURLPrefix + host + invokerURLSuffix. If true getHostName() is used, false getHostAddress().

Specified by:
setUseHostName in interface HttpProxyFactoryMBean (src)

getExportedInterface

public java.lang.Class getExportedInterface()
Description copied from interface: HttpProxyFactoryMBean (src)
Get the RMI compatible interface that the HttpInvokerProxy implements

Specified by:
getExportedInterface in interface HttpProxyFactoryMBean (src)

setExportedInterface

public void setExportedInterface(java.lang.Class exportedInterface)
Description copied from interface: HttpProxyFactoryMBean (src)
Set the RMI compatible interface that the HttpInvokerProxy implements

Specified by:
setExportedInterface in interface HttpProxyFactoryMBean (src)

getClientInterceptors

public org.w3c.dom.Element getClientInterceptors()
Specified by:
getClientInterceptors in interface HttpProxyFactoryMBean (src)

setClientInterceptors

public void setClientInterceptors(org.w3c.dom.Element config)
                           throws java.lang.Exception
Specified by:
setClientInterceptors in interface HttpProxyFactoryMBean (src)
Throws:
java.lang.Exception

getProxy

public java.lang.Object getProxy()
Description copied from interface: HttpProxyFactoryMBean (src)
Get the proxy instance created by the factory.

Specified by:
getProxy in interface HttpProxyFactoryMBean (src)

getProxy

public java.lang.Object getProxy(java.lang.Object id)
Description copied from interface: HttpProxyFactoryMBean (src)
Create a new proxy instance with the given id, no jndi name and all other settings the same as the jndi bound proxy.

Specified by:
getProxy in interface HttpProxyFactoryMBean (src)

startService

protected void startService()
                     throws java.lang.Exception
Initializes the servlet.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

defineDefaultInterceptors

protected java.util.ArrayList defineDefaultInterceptors()
Build the default interceptor list. This consists of: ClientMethodInterceptor InvokerInterceptor


createInvoker

protected Invoker (src)  createInvoker()
                         throws java.lang.Exception
Create the Invoker

Throws:
java.lang.Exception

checkInvokerURL

protected void checkInvokerURL()
                        throws java.net.UnknownHostException
Validate that the invokerURL is set, and if not build it from the invokerURLPrefix + host + invokerURLSuffix. The host value will be taken from the jboss.bind.address system property if its a valid address, InetAddress.getLocalHost otherwise.

Throws:
java.net.UnknownHostException