org.apache.jk.server

Class JkCoyoteHandler

Implemented Interfaces:
ActionHook, InputBuffer, MBeanRegistration, NotificationListener, OutputBuffer, ProtocolHandler

public class JkCoyoteHandler
extends JkHandler
implements ProtocolHandler, ActionHook, OutputBuffer, InputBuffer

Plugs Jk2 into Coyote. Must be named "type=JkHandler,name=container"

Field Summary

int
JK_STATUS_CLOSED
int
JK_STATUS_HEAD
int
JK_STATUS_NEW
protected JkMain
jkMain
protected static org.apache.commons.logging.Log
log

Fields inherited from class org.apache.jk.core.JkHandler

ERROR, HANDLE_FLUSH, HANDLE_RECEIVE_PACKET, HANDLE_SEND_PACKET, HANDLE_THREAD_END, LAST, OK, domain, id, mserver, name, next, nextName, oname, properties, wEnv

Method Summary

void
action(ActionCode actionCode, Object param)
void
destroy()
Clean up and stop the handler
int
doRead(ByteChunk chunk, Request req)
Return from the input stream.
int
doWrite(ByteChunk chunk, Response res)
Adapter
getAdapter()
Object
getAttribute(String name)
Retrieve config info.
JkMain
getJkMain()
String
getProperty(String name)
void
init()
Start the protocol
int
invoke(Msg msg, MsgContext ep)
void
pause()
ObjectName
preRegister(MBeanServer server, ObjectName oname)
void
resume()
void
setAdapter(Adapter adapter)
The adapter, used to call the connector
void
setAttribute(String name, Object value)
Pass config info
void
setProperty(String name, String value)
Set a property.
void
start()

Methods inherited from class org.apache.jk.core.JkHandler

addHandlerCallback, createMsgContext, destroy, getDomain, getId, getName, getNext, getObjectName, getProperty, handleNotification, init, invoke, pause, postDeregister, postRegister, preDeregister, preRegister, resume, setId, setName, setNext, setNext, setProperty, setWorkerEnv

Field Details

JK_STATUS_CLOSED

public final int JK_STATUS_CLOSED


JK_STATUS_HEAD

public final int JK_STATUS_HEAD


JK_STATUS_NEW

public final int JK_STATUS_NEW


jkMain

protected JkMain jkMain


log

protected static org.apache.commons.logging.Log log

Method Details

action

public void action(ActionCode actionCode,
                   Object param)
Specified by:
action in interface ActionHook


destroy

public void destroy()
Clean up and stop the handler
Specified by:
destroy in interface ProtocolHandler
Overrides:
destroy in interface JkHandler


doRead

public int doRead(ByteChunk chunk,
                  Request req)
            throws IOException
Return from the input stream. IMPORTANT: the current model assumes that the protocol will 'own' the buffer and return a pointer to it in ByteChunk ( i.e. the param will have chunk.getBytes()==null before call, and the result after the call ).
Specified by:
doRead in interface InputBuffer


doWrite

public int doWrite(ByteChunk chunk,
                   Response res)
            throws IOException
Specified by:
doWrite in interface OutputBuffer


getAdapter

public Adapter getAdapter()
Specified by:
getAdapter in interface ProtocolHandler


getAttribute

public Object getAttribute(String name)
Retrieve config info. Primarily for use with the admin webapp.
Specified by:
getAttribute in interface ProtocolHandler


getJkMain

public JkMain getJkMain()


getProperty

public String getProperty(String name)
Overrides:
getProperty in interface JkHandler


init

public void init()
Start the protocol
Specified by:
init in interface ProtocolHandler
Overrides:
init in interface JkHandler


invoke

public int invoke(Msg msg,
                  MsgContext ep)
            throws IOException
Overrides:
invoke in interface JkHandler


pause

public void pause()
            throws Exception
Specified by:
pause in interface ProtocolHandler
Overrides:
pause in interface JkHandler


preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName oname)
            throws Exception
Overrides:
preRegister in interface JkHandler


resume

public void resume()
            throws Exception
Specified by:
resume in interface ProtocolHandler
Overrides:
resume in interface JkHandler


setAdapter

public void setAdapter(Adapter adapter)
The adapter, used to call the connector
Specified by:
setAdapter in interface ProtocolHandler


setAttribute

public void setAttribute(String name,
                         Object value)
Pass config info
Specified by:
setAttribute in interface ProtocolHandler


setProperty

public void setProperty(String name,
                        String value)
Set a property. Name is a "component.property". JMX should be used instead.
Overrides:
setProperty in interface JkHandler


start

public void start()
Specified by:
start in interface ProtocolHandler


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.