org.apache.jk.common

Class Shm

Implemented Interfaces:
MBeanRegistration, NotificationListener
Known Direct Subclasses:
Shm14

public class Shm
extends JniHandler

Handle the shared memory objects.

Author:
Costin Manolache

Field Summary

Fields inherited from class org.apache.jk.common.JniHandler

C2B_NOTE, JK_HANDLE_JNI_DISPATCH, JK_HANDLE_SHM_DISPATCH, MB_NOTE, MSG_NOTE, apr, jkHome, nativeJkHandlerP

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

Constructor Summary

Shm()

Method Summary

void
destroy()
Clean up and stop the handler
void
dumpScoreboard(String fname)
void
execute()
void
init()
Should register the request types it can handle, same style as apache2.
void
initCli()
Local initialization - for standalone use
int
invoke(Msg msg, MsgContext ep)
static void
main(args[] )
void
registerTomcat(String host, int port, String unixDomain)
Register a tomcat instance XXX make it more flexible
void
resetScoreboard()
void
setDump(String dumpFile)
Copy the scoreboard in a file for debugging Will also log a lot of information about what's in the scoreboard.
void
setFile(String f)
Scoreboard location
void
setGroup(String grp)
Mark this instance as belonging to a group
void
setHelp(boolean b)
void
setHost(String host)
Ajp13 host
void
setPort(int port)
Ajp13 port
void
setReset(boolean b)
Set this to get the scoreboard reset.
void
setSize(int size)
Size.
void
setUnixSocket(String unixSocket)
Unix socket where tomcat is listening.
void
setUnregister(boolean unregister)
Set this option to mark the tomcat instance as 'down', so apache will no longer forward messages to it.
void
unRegisterTomcat(String host, int port)

Methods inherited from class org.apache.jk.common.JniHandler

appendString, createMsgContext, destroyJkComponent, getJkHome, init, initJkComponent, initNative, invoke, nativeDispatch, pause, recycleNative, resume, setJkHome, setNativeAttribute, setNativeEndpoint

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

Constructor Details

Shm

public Shm()

Method Details

destroy

public void destroy()
            throws IOException
Clean up and stop the handler
Overrides:
destroy in interface JkHandler


dumpScoreboard

public void dumpScoreboard(String fname)
            throws IOException


execute

public void execute()


init

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


initCli

public void initCli()
            throws IOException
Local initialization - for standalone use


invoke

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


main

public static void main(args[] )


registerTomcat

public void registerTomcat(String host,
                           int port,
                           String unixDomain)
            throws IOException
Register a tomcat instance XXX make it more flexible


resetScoreboard

public void resetScoreboard()
            throws IOException


setDump

public void setDump(String dumpFile)
Copy the scoreboard in a file for debugging Will also log a lot of information about what's in the scoreboard.


setFile

public void setFile(String f)
Scoreboard location


setGroup

public void setGroup(String grp)
Mark this instance as belonging to a group


setHelp

public void setHelp(boolean b)


setHost

public void setHost(String host)
Ajp13 host


setPort

public void setPort(int port)
Ajp13 port


setReset

public void setReset(boolean b)
Set this to get the scoreboard reset. The shm segment will be destroyed and a new one created, with the provided size. Requires "file" and "size".


setSize

public void setSize(int size)
Size. Used only if the scoreboard is to be created.


setUnixSocket

public void setUnixSocket(String unixSocket)
Unix socket where tomcat is listening. Use it only if tomcat is on the same host, of course


setUnregister

public void setUnregister(boolean unregister)
Set this option to mark the tomcat instance as 'down', so apache will no longer forward messages to it. Note that requests with a session will still try this host first. This can be used to implement gracefull shutdown. Host and port are still required, since they are used to identify tomcat.


unRegisterTomcat

public void unRegisterTomcat(String host,
                             int port)
            throws IOException


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