|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mx4j.adaptor.http.HttpAdaptor
HttpAdaptor sets the basic adaptor listening for HTTP requests
Constructor Summary | |
---|---|
HttpAdaptor()
Default Constructor added so that we can have some additional constructors as well. |
|
HttpAdaptor(int port)
Overloaded constructor to allow the port to be set. |
|
HttpAdaptor(int port,
java.lang.String host)
Overloaded constructor to allow the port to be set. |
|
HttpAdaptor(java.lang.String host)
Overloaded constructor to allow the host to be set. |
Method Summary | |
---|---|
void |
addAuthorization(java.lang.String username,
java.lang.String password)
Adds an authorization pair as username/password |
void |
addCommandProcessor(java.lang.String path,
HttpCommandProcessor processor)
Adds a command processor object |
void |
addCommandProcessor(java.lang.String path,
java.lang.String processorClass)
Adds a command processor object by class |
protected void |
buildCommands()
Build the commands |
protected void |
findUnknownElement(java.lang.String path,
HttpOutputStream out,
HttpInputStream in)
|
java.lang.String |
getAuthenticationMethod()
Authentication Method |
java.lang.String |
getHost()
Return the host name the server will be listening to. |
int |
getPort()
Returns the port where the server is running on. |
ProcessorMBean |
getProcessor()
|
protected HttpCommandProcessor |
getProcessor(java.lang.String path)
|
ObjectName |
getProcessorName()
|
long |
getRequestsCount()
Requests count |
java.util.Date |
getStartDate()
Starting date |
java.lang.String |
getVersion()
Gets the HttpAdaptor version |
boolean |
isActive()
Indicates whether the server's running |
void |
postDeregister()
Called upon after the MBean has been de-registered. |
protected void |
postProcess(HttpOutputStream out,
HttpInputStream in,
org.w3c.dom.Document document)
|
protected void |
postProcess(HttpOutputStream out,
HttpInputStream in,
java.lang.Exception e)
|
void |
postRegister(java.lang.Boolean registrationDone)
Called upon after a registration ( successful or not ). |
void |
preDeregister()
Called upon before an MBean will be de-registered by
the MBeanServer . |
protected java.lang.String |
preProcess(java.lang.String path)
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Gathers some basic data |
void |
removeCommandProcessor(java.lang.String path)
Removes a command processor object by class |
void |
restart()
Deprecated. as of RC 1 |
void |
setAuthenticationMethod(java.lang.String method)
Sets the Authentication Method. |
void |
setHost(java.lang.String host)
Sets the host name where the server will be listening |
void |
setPort(int port)
Sets the value of the server's port |
void |
setProcessor(ProcessorMBean processor)
Sets the object which will post process the XML results. |
void |
setProcessorClass(java.lang.String processorClass)
Sets the classname of the object which will post process the XML results. |
void |
setProcessorName(ObjectName processorName)
Sets the object name which will post process the XML result. |
void |
setProcessorNameString(java.lang.String processorName)
Sets the object name of the PostProcessor MBean. |
void |
setSocketFactory(AdaptorServerSocketFactory factory)
Sets the object which create the server sockets |
void |
setSocketFactoryName(ObjectName factoryName)
Sets the factory's object name which will create the server sockets |
void |
setSocketFactoryNameString(java.lang.String factoryName)
Sets the factory's object name which will create the server sockets |
void |
start()
Starts the server |
void |
stop()
Stops the HTTP daemon |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HttpAdaptor()
public HttpAdaptor(int port)
This constructor uses the default host or the host must be set later.
port
- The port on which the HttpAdaptor should listenpublic HttpAdaptor(java.lang.String host)
This constructor uses the default port or the port must be set later.
host
- The host on which the HttpAdaptor should listenpublic HttpAdaptor(int port, java.lang.String host)
port
- The port on which the HttpAdaptor should listenhost
- The host on which the HttpAdaptor should listenMethod Detail |
public void setPort(int port)
setPort
in interface HttpAdaptorMBean
port
- the new port's valuepublic int getPort()
getPort
in interface HttpAdaptorMBean
public void setHost(java.lang.String host)
setHost
in interface HttpAdaptorMBean
host
- Server's hostpublic java.lang.String getHost()
getHost
in interface HttpAdaptorMBean
public void setAuthenticationMethod(java.lang.String method)
setAuthenticationMethod
in interface HttpAdaptorMBean
method
- none/basic/digestpublic java.lang.String getAuthenticationMethod()
getAuthenticationMethod
in interface HttpAdaptorMBean
public void setProcessor(ProcessorMBean processor)
setProcessor
in interface HttpAdaptorMBean
processor
- a Post processor objectpublic void setProcessorClass(java.lang.String processorClass)
setProcessorClass
in interface HttpAdaptorMBean
processor
- a Post processor objectpublic void setProcessorNameString(java.lang.String processorName) throws MalformedObjectNameException
setProcessorNameString
in interface HttpAdaptorMBean
processor
- a Post processor objectpublic void setProcessorName(ObjectName processorName)
setProcessorName
in interface HttpAdaptorMBean
processorName
- The new processorName valuepublic ProcessorMBean getProcessor()
getProcessor
in interface HttpAdaptorMBean
public ObjectName getProcessorName()
getProcessorName
in interface HttpAdaptorMBean
public void setSocketFactory(AdaptorServerSocketFactory factory)
setSocketFactory
in interface HttpAdaptorMBean
factory
- the socket factorypublic void setSocketFactoryName(ObjectName factoryName)
setSocketFactoryName
in interface HttpAdaptorMBean
factory
- the socket factorypublic void setSocketFactoryNameString(java.lang.String factoryName) throws MalformedObjectNameException
setSocketFactoryNameString
in interface HttpAdaptorMBean
factory
- the socket factorypublic boolean isActive()
isActive
in interface HttpAdaptorMBean
public java.util.Date getStartDate()
getStartDate
in interface HttpAdaptorMBean
public long getRequestsCount()
getRequestsCount
in interface HttpAdaptorMBean
public java.lang.String getVersion()
getVersion
in interface HttpAdaptorMBean
public void addCommandProcessor(java.lang.String path, HttpCommandProcessor processor)
addCommandProcessor
in interface HttpAdaptorMBean
public void addCommandProcessor(java.lang.String path, java.lang.String processorClass)
addCommandProcessor
in interface HttpAdaptorMBean
public void removeCommandProcessor(java.lang.String path)
removeCommandProcessor
in interface HttpAdaptorMBean
public void start() throws java.io.IOException
start
in interface HttpAdaptorMBean
public void restart() throws java.io.IOException
public void stop()
stop
in interface HttpAdaptorMBean
public void addAuthorization(java.lang.String username, java.lang.String password)
addAuthorization
in interface HttpAdaptorMBean
public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
preRegister
in interface MBeanRegistration
javax.management.MBeanRegistration
server
- The MBeanServer on which the MBean will be registered.name
- The ObjectName
of the MBean.java.lang.Exception
- Exception of the operation. Note that this is caught
by the MBeanServer
and re-thrown as an
MBeanRegistrationException
.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration
postRegister
in interface MBeanRegistration
javax.management.MBeanRegistration
registrationDone
- Evaluates to true of the registrations
is successful, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration
MBean
will be de-registered by
the MBeanServer
.preDeregister
in interface MBeanRegistration
javax.management.MBeanRegistration
java.lang.Exception
- Would be caught by the MBeanServer
and rethrown as an MBeanRegistrationException.public void postDeregister()
MBeanRegistration
postDeregister
in interface MBeanRegistration
protected HttpCommandProcessor getProcessor(java.lang.String path)
protected void buildCommands()
protected void postProcess(HttpOutputStream out, HttpInputStream in, org.w3c.dom.Document document) throws java.io.IOException, JMException
protected void findUnknownElement(java.lang.String path, HttpOutputStream out, HttpInputStream in) throws java.io.IOException, JMException
protected java.lang.String preProcess(java.lang.String path) throws java.io.IOException, JMException
protected void postProcess(HttpOutputStream out, HttpInputStream in, java.lang.Exception e) throws java.io.IOException, JMException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |