com.sun.grizzly.http.jk.core
Class JkHandler

java.lang.Object
  extended by com.sun.grizzly.http.jk.core.JkHandler
All Implemented Interfaces:
EventListener, MBeanRegistration, NotificationListener
Direct Known Subclasses:
AprImpl, ChannelNioSocket, ChannelShm, ChannelSocket, HandlerDispatch, HandlerRequest, JkCoyoteHandler, JniHandler, WorkerDummy

public class JkHandler
extends Object
implements MBeanRegistration, NotificationListener

Author:
Costin Manolache

Field Summary
protected  String domain
           
static int ERROR
           
static int HANDLE_FLUSH
           
static int HANDLE_RECEIVE_PACKET
           
static int HANDLE_SEND_PACKET
           
static int HANDLE_THREAD_END
           
protected  int id
           
static int LAST
           
protected  MBeanServer mserver
           
protected  String name
           
protected  JkHandler next
           
protected  String nextName
           
static int OK
           
protected  ObjectName oname
           
protected  Properties properties
           
protected  WorkerEnv wEnv
           
 
Constructor Summary
JkHandler()
           
 
Method Summary
 void addHandlerCallback(JkHandler w)
          Experimental, will be replaced.
 MsgContext createMsgContext()
           
 MsgContext createMsgContext(int bsize)
           
 void destroy()
          Clean up and stop the handler
 String getDomain()
           
 int getId()
           
 String getName()
           
 String getNext()
           
 ObjectName getObjectName()
           
 String getProperty(String name)
           
 void handleNotification(Notification notification, Object handback)
           
 void init()
          Should register the request types it can handle, same style as apache2.
 int invoke(Msg msg, MsgContext mc)
           
 void pause()
           
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName oname)
           
 void resume()
           
 void setId(int id)
          Set the id of the worker.
 void setName(String s)
          Set the name of the handler.
 void setNext(JkHandler h)
          Catalina-style "recursive" invocation.
 void setNext(String s)
           
 void setProperty(String name, String value)
           
 void setWorkerEnv(WorkerEnv we)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
See Also:
Constant Field Values

LAST

public static final int LAST
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

properties

protected Properties properties

wEnv

protected WorkerEnv wEnv

next

protected JkHandler next

nextName

protected String nextName

name

protected String name

id

protected int id

HANDLE_RECEIVE_PACKET

public static final int HANDLE_RECEIVE_PACKET
See Also:
Constant Field Values

HANDLE_SEND_PACKET

public static final int HANDLE_SEND_PACKET
See Also:
Constant Field Values

HANDLE_FLUSH

public static final int HANDLE_FLUSH
See Also:
Constant Field Values

HANDLE_THREAD_END

public static final int HANDLE_THREAD_END
See Also:
Constant Field Values

domain

protected String domain

oname

protected ObjectName oname

mserver

protected MBeanServer mserver
Constructor Detail

JkHandler

public JkHandler()
Method Detail

setWorkerEnv

public void setWorkerEnv(WorkerEnv we)

setName

public void setName(String s)
Set the name of the handler. Will allways be called by worker env after creating the worker.


getName

public String getName()

setId

public void setId(int id)
Set the id of the worker. We use an id for faster dispatch. Since we expect a decent number of handler in system, the id is unique - that means we may have to allocate bigger dispatch tables. ( easy to fix if needed )


getId

public int getId()

setNext

public void setNext(JkHandler h)
Catalina-style "recursive" invocation. A chain is used for Apache/3.3 style iterative invocation.


setNext

public void setNext(String s)

getNext

public String getNext()

init

public void init()
          throws IOException
Should register the request types it can handle, same style as apache2.

Throws:
IOException

destroy

public void destroy()
             throws IOException
Clean up and stop the handler

Throws:
IOException

createMsgContext

public MsgContext createMsgContext()

createMsgContext

public MsgContext createMsgContext(int bsize)

invoke

public int invoke(Msg msg,
                  MsgContext mc)
           throws IOException
Throws:
IOException

setProperty

public void setProperty(String name,
                        String value)

getProperty

public String getProperty(String name)

addHandlerCallback

public void addHandlerCallback(JkHandler w)
Experimental, will be replaced. This allows handlers to be notified when other handlers are added.


handleNotification

public void handleNotification(Notification notification,
                               Object handback)
Specified by:
handleNotification in interface NotificationListener

getObjectName

public ObjectName getObjectName()

getDomain

public String getDomain()

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName oname)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration

pause

public void pause()
           throws Exception
Throws:
Exception

resume

public void resume()
            throws Exception
Throws:
Exception


Copyright © 2012 Oracle Corporation. All Rights Reserved.