Methods Summary |
---|
public void | destroy()
if( !started ) return;
started = false;
getJkMain().stop();
|
public org.apache.coyote.Adapter | getAdapter()
return adapter;
|
public java.lang.Object | getAttribute(java.lang.String name)Retrieve config info.
Primarily for use with the admin webapp.
return getJkMain().getProperty(name);
|
public java.util.Iterator | getAttributeNames()
return properties.keySet().iterator();
|
public JkMain | getJkMain()
if( jkMain == null ) {
jkMain=new JkMain();
jkMain.setWorkerEnv(wEnv);
}
return jkMain;
|
public java.lang.String | getProperty(java.lang.String name)
return properties.getProperty(name) ;
|
public void | init()Start the protocol
if( started ) return;
started=true;
if( wEnv==null ) {
// we are probably not registered - not very good.
wEnv=getJkMain().getWorkerEnv();
wEnv.addHandler("container", this );
}
try {
// jkMain.setJkHome() XXX;
getJkMain().init();
} catch( Exception ex ) {
log.error("Error during init",ex);
}
|
public int | invoke(org.apache.jk.core.Msg msg, org.apache.jk.core.MsgContext ep)
if( ep.isLogTimeEnabled() )
ep.setLong( MsgContext.TIMER_PRE_REQUEST, System.currentTimeMillis());
Request req=ep.getRequest();
Response res=req.getResponse();
if( log.isDebugEnabled() )
log.debug( "Invoke " + req + " " + res + " " + req.requestURI().toString());
res.setNote( epNote, ep );
ep.setStatus( MsgContext.JK_STATUS_HEAD );
RequestInfo rp = req.getRequestProcessor();
rp.setStage(Constants.STAGE_SERVICE);
try {
adapter.service( req, res );
} catch( Exception ex ) {
log.info("Error servicing request " + req,ex);
}
if(ep.getStatus() != MsgContext.JK_STATUS_CLOSED) {
res.finish();
}
req.recycle();
req.updateCounters();
res.recycle();
ep.recycle();
if( ep.getStatus() == MsgContext.JK_STATUS_ERROR ) {
return ERROR;
}
ep.setStatus( MsgContext.JK_STATUS_NEW );
rp.setStage(Constants.STAGE_KEEPALIVE);
return OK;
|
public void | pause()
if(!paused) {
paused = true;
getJkMain().pause();
}
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName oname)
// override - we must be registered as "container"
this.name="container";
return super.preRegister(server, oname);
|
public void | resume()
if(paused) {
paused = false;
getJkMain().resume();
}
|
public void | setAdapter(org.apache.coyote.Adapter adapter)The adapter, used to call the connector
this.adapter=adapter;
|
public void | setAttribute(java.lang.String name, java.lang.Object value)Pass config info
if( log.isDebugEnabled())
log.debug("setAttribute " + name + " " + value );
if( value instanceof String )
this.setProperty( name, (String)value );
|
public void | setProperty(java.lang.String name, java.lang.String value)Set a property. Name is a "component.property". JMX should
be used instead.
if( log.isTraceEnabled())
log.trace("setProperty " + name + " " + value );
getJkMain().setProperty( name, value );
properties.put( name, value );
|
public void | start()
try {
if( oname != null && getJkMain().getDomain() == null) {
try {
ObjectName jkmainOname =
new ObjectName(oname.getDomain() + ":type=JkMain");
Registry.getRegistry(null, null)
.registerComponent(getJkMain(), jkmainOname, "JkMain");
} catch (Exception e) {
log.error( "Error registering jkmain " + e );
}
}
getJkMain().start();
} catch( Exception ex ) {
log.error("Error during startup",ex);
}
|