org.apache.jk.server

Class JkMain

public class JkMain extends Object implements MBeanRegistration

Main class used to startup and configure jk. It manages the conf/jk2.properties file and is the target of JMX proxy. It implements a policy of save-on-change - whenever a property is changed at runtime the jk2.properties file will be overriden. You can edit the config file when tomcat is stoped ( or if you don't use JMX or other admin tools ). The format of jk2.properties:
TYPE[.LOCALNAME].PROPERTY_NAME=VALUE
Set a property on the associated component. TYPE will be used to find the class name and instantiate the component. LOCALNAME allows multiple instances. In JMX mode, TYPE and LOCALNAME will form the JMX name ( eventually combined with a 'jk2' component )
NAME=VALUE
Define global properties to be used in ${} substitutions
class.COMPONENT_TYPE=JAVA_CLASS_NAME
Adds a new 'type' of component. We predefine all known types.
Instances are created the first time a component name is found. In addition, 'handler.list' property will override the list of 'default' components that are loaded automatically. Note that the properties file is just one (simplistic) way to configure jk. We hope to see configs based on registry, LDAP, db, etc. ( XML is not necesarily better )

Author: Costin Manolache

Field Summary
protected Stringdomain
protected MBeanServermserver
protected ObjectNameoname
Constructor Summary
JkMain()
Method Summary
StringgetChannelClassName()
StringgetDomain()
StringgetErr()
longgetInitTime()
The time it took to initialize jk ( ms)
StringgetJkHome()
static JkMaingetJkMain()
ObjectNamegetObjectName()
StringgetOut()
StringgetPropertiesFile()
ObjectgetProperty(String name)
Retrieve a property.
longgetStartTime()
The time it took to start jk ( ms )
StringgetWorkerClassName()
WorkerEnvgetWorkerEnv()
voidinit()
static voidmain(String[] args)
voidpause()
voidpostDeregister()
voidpostRegister(Boolean registrationDone)
voidpreDeregister()
ObjectNamepreRegister(MBeanServer server, ObjectName name)
voidresume()
voidsaveProperties()
voidsetBeanProperty(Object target, String name, String val)
voidsetChannelClassName(String name)
Set the channelClassName that will used to connect to httpd.
voidsetErr(String s)
voidsetJkHome(String s)
Set the base dir of jk2.
voidsetOut(String s)
voidsetPropertiesFile(String p)
Load a .properties file into and set the values into jk2 configuration.
voidsetProperty(String n, String v)
Set a name/value as a jk2 property
voidsetPropertyString(String handlerN, String name, String val)
voidsetSaveProperties(boolean b)
voidsetWorkerClassName(String name)
Set the workerClassName that will handle the request.
voidsetWorkerEnv(WorkerEnv wEnv)
voidstart()
voidstop()

Field Detail

domain

protected String domain

mserver

protected MBeanServer mserver

oname

protected ObjectName oname

Constructor Detail

JkMain

public JkMain()

Method Detail

getChannelClassName

public String getChannelClassName()

getDomain

public String getDomain()

getErr

public String getErr()

getInitTime

public long getInitTime()
The time it took to initialize jk ( ms)

getJkHome

public String getJkHome()

getJkMain

public static JkMain getJkMain()

getObjectName

public ObjectName getObjectName()

getOut

public String getOut()

getPropertiesFile

public String getPropertiesFile()

getProperty

public Object getProperty(String name)
Retrieve a property.

getStartTime

public long getStartTime()
The time it took to start jk ( ms )

getWorkerClassName

public String getWorkerClassName()

getWorkerEnv

public WorkerEnv getWorkerEnv()

init

public void init()

main

public static void main(String[] args)

pause

public void pause()

postDeregister

public void postDeregister()

postRegister

public void postRegister(Boolean registrationDone)

preDeregister

public void preDeregister()

preRegister

public ObjectName preRegister(MBeanServer server, ObjectName name)

resume

public void resume()

saveProperties

public void saveProperties()

setBeanProperty

public void setBeanProperty(Object target, String name, String val)

setChannelClassName

public void setChannelClassName(String name)
Set the channelClassName that will used to connect to httpd.

setErr

public void setErr(String s)

setJkHome

public void setJkHome(String s)
Set the base dir of jk2. ( including WEB-INF if in a webapp ). We'll try to guess it from classpath if none is set ( for example on command line ), but if in a servlet environment you need to use Context.getRealPath or a system property or set it expliciltey.

setOut

public void setOut(String s)

setPropertiesFile

public void setPropertiesFile(String p)
Load a .properties file into and set the values into jk2 configuration.

setProperty

public void setProperty(String n, String v)
Set a name/value as a jk2 property

setPropertyString

public void setPropertyString(String handlerN, String name, String val)

setSaveProperties

public void setSaveProperties(boolean b)

setWorkerClassName

public void setWorkerClassName(String name)
Set the workerClassName that will handle the request. ( sort of 'pivot' in axis :-)

setWorkerEnv

public void setWorkerEnv(WorkerEnv wEnv)

start

public void start()

stop

public void stop()
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.