input
stringlengths
10
828
output
stringlengths
5
107
public void set root deployment filename final string filename this root deployable filename filename
set the filename of the root deployable that will be used to finalize
public string get host address if host address null try host address java net inet address get local host get host address catch java net unknown host exception e log error error looking up local address e host address unknown return host address
returns inet address
public string get root deployment filename if root deployable filename null root deployable filename props get property server config root deployment filename server config default root deployment filename return root deployable filename
get the filename of the root deployable that will be used to finalize
public void check incomplete deployments throws deployment exception try collection waiting for classes collection server invoke service controller list waiting mbeans new object new string collection waiting for depends collection server invoke service controller list incompletely deployed new object new string incomplete deployment exception ide new incomplete deployment exception waiting for classes waiting for depends list incompletely deployed list waiting for deployer if ide is empty throw ide end of if catch jmexception jme throw new deployment exception jmxexception decoder decode jme end of try catch
check the current deployment states and generate a incomplete deployment exception
public void validate deployment state deployment info di deployment state state array list mbeans new array list di mbeans if di deployed object null mbeans add di deployed object boolean mbeans state is valid true for int m 0 m mbeans size m object name service name object name mbeans get m service context ctx this get service context service name if ctx null state deployment state started mbeans state is valid ctx state service context running if mbeans state is valid true di state state
go through the mbeans of the deployment info and validate that they
private void stop watching throws instance not found exception mbean registration exception log debug stop watching synchronized m watching start stop lock if is watching set is watching false get watching thread interrupt try get watching thread join catch interrupted exception ie stop mirroring log debug stop watching done
stop watching the jmx agent
private url get url final string name throws malformed urlexception string value props get property name null if value null if value ends with value return new url value return null
get a url from configuration
public void exit exit 1
shutdown the server the jvm and run shutdown hooks
private file get file final string name string value props get property name null if value null return new file value return null
get a file from configuration
public string list thread dump thread group root get root thread group i m not sure why what gets reported is off by 1 but i m adjusting so that it is consistent with the display int active threads root active count 1 i m not sure why what gets reported is off by 1 but i m adjusting so that it is consistent with the display int active groups root active group count 1 string rc b total threads b active threads br b total thread groups b active groups br get thread group info root return rc
return a listing of the active threads and thread groups
public void halt final int exitcode send a notification that the startup is complete notification msg new notification stop notification type this 2 send notification msg start in new thread so that we might have a chance to give positive feed back to requesting client of success new thread public void run system err println halting the system now runtime get runtime halt exitcode start
forcibly terminates the currently running java virtual machine
public map get properties return collections unmodifiable map props
returns an unmodifiable map of version properties
private void do watching log debug do watching thread current thread get name while is watching try watch once thread current thread sleep get granularity catch interrupted exception ie log debug done watching thread current thread get name
worker method called by code start watching code to perform watching runs
public string get property final string name return props get property name
returns the value for the given property name
public int get major return get int property version major
returns the major number of the version
public string display package info string pkg name package pkg package get package pkg name if pkg null return h2 package pkg name not found h2 string buffer info new string buffer h2 package pkg name h2 display package info pkg info return info to string
display the java
public int get minor return get int property version minor
returns the minor number of the version
public int get revision return get int property version revision
returns the revision number of the version
public string get tag return props get property version tag
returns the tag of the version
public string get name return props get property version name
returns the name number of the version
public string get build id return props get property build id
returns the build identifier for this version
public string get build number return props get property build number
returns the build number for this version
public string get build date return props get property build date
returns the build date for this version
public void halt halt 1
forcibly terminates the currently running java virtual machine
public string to string string buffer buff new string buffer buff append get major append buff append get minor append buff append get revision append get tag buff append append get build id append return buff to string
returns the version information as a string
private int get int property final string name try return integer value of props get property name int value catch exception e return 1
returns a property value as an int
private long get long property final string name try return long value of props get property name long value catch exception e return 1
returns a property value as a long
private properties load properties props new properties try input stream in version class get resource as stream org elba version properties props load in in close catch ioexception e throw new error missing version properties return props
load the version properties from a resource
private void log memory usage final runtime rt log info total free memory rt total memory rt free memory
a simple helper used to log the runtime memory information
public void shutdown log info stopping name to service map size services list services copy new array list installed services int service counter 0 object name name null list iterator i services copy list iterator services copy size while i has previous service context ctx service context i previous name ctx object name try remove name service counter catch throwable e log error could not remove name e log info stopped service counter services
describe code shutdown code method here
public void run garbage collector runtime rt runtime get runtime log memory usage rt rt gc log info hinted to the jvm to run garbage collection log memory usage rt
hint to the jvm to run the garbage collector
public void run finalization runtime get runtime run finalization log info hinted to the jvm to run any pending object finalizations
hint to the jvm to run any pending object finailizations
public ejbobject get ejbobject return get session context get ejbobject
helper method to get the ejbobject associated with this session bean
public void trace method calls final boolean flag runtime get runtime trace method calls flag boolean value
enable or disable tracing method calls at the runtime level
protected void set modified final boolean flag modified flag
change the modified flag
protected void set modified set modified true
mark this bean as modified
public string get message return nested throwable util get message super get message nested
returns the composite throwable message
public void print stack trace final java io print stream stream if nested null nested throwable parent trace enabled super print stack trace stream nested throwable util print nested stream
prints the composite message and the embedded stack trace to the
public void print stack trace final java io print writer writer if nested null nested throwable parent trace enabled super print stack trace writer nested throwable util print nested writer
prints the composite message and the embedded stack trace to the
public void trace instructions final boolean flag runtime get runtime trace instructions flag boolean value
enable or disable tracing instructions the runtime level
public ejbobject get ejbobject throws illegal state exception return get entity context get ejbobject
helper method to get the ejbobject associated with this entity bean
protected void process final message msg throws exception throw new not implemented exception
override with custom message processing
public void ejb store throws ejbexception remote exception reset the modified flag set modified false
clears the modified flag
public void set category string category log logger get logger category
allow the log category to be set from the config category attribute
public void invalidate string name if prefix null name prefix name cache remove name
invalidate the cached home for the given name if there is one
public void set use jaas boolean use jaas this use jaas use jaas
a flag to indicate if the security manager implements the subject security manager
public void invalidate final class type invalidate type get name
invalidate the cached home for the given name if there is one
public string get info return get class get name
return descriptive information about this logger implementation and
public void set subject attribute name string subject attribute name this subject attribute name subject attribute name
the name of the request attribute under with the authenticated jaas
public void invalidate cache clear
invalidate all cached home refernces
protected void thread sleep try thread sleep check interval 1000 l catch interrupted exception e
sleep for the duration specified by the code check interval code
protected void thread start if thread null return thread done false thread name cluster manager cleanup thread manager context path thread new thread this thread name thread set daemon true thread set context class loader manager get container get loader get class loader thread start
start up the cleanup thread
public void snapshot string id try find the session that has been modified clustered session session clustered session manager find session id replicate it manager store session session catch exception e log warn failed to replicate session id id e
instant replication of the modified session
public void log exception exception string message log error message exception
writes the specified exception and message to a servlet log file
public void snapshot string id try clustered session session clustered session manager find session id synchronized sessions sessions put id session catch exception e log warn failed to replicate session id id e
store the modified session in a hashmap for the distributor thread
public void log string message int verbosity switch verbosity case fatal log fatal message break case error log error message break case warning log warn message break case information log info message break case debug log debug message break
writes the specified message to the servlet log file usually an event
protected void process sessions synchronized sessions iterator iter sessions values iterator distribute all modified sessions while iter has next clustered session session clustered session iter next manager store session session sessions clear
distribute all modified sessions
public void log string message throwable throwable throwable root cause null if throwable instanceof lifecycle exception root cause lifecycle exception throwable get throwable else if throwable instanceof servlet exception root cause servlet exception throwable get root cause log error message throwable if root cause null log error root cause root cause
writes an explanatory message and a stack trace for a given
public void stop stop thread synchronized sessions sessions clear
stop the snapshot manager
public session create session clustered session session new clustered session this log session set new true session set creation time system current time millis session set max inactive interval this max inactive interval string session id this get next id string jvm route this get jvm route if jvm route null session id jvm route session set id session id session set valid true return session
create a new session
public void log string message throwable throwable int verbosity switch verbosity case fatal log fatal message throwable break case error log error message throwable break case warning log warn message throwable break case information log info message throwable break case debug log debug message throwable break
writes the specified message and exception to the servlet log file
protected void start thread if thread null return thread new thread this clustered session distributor context path thread set daemon true thread set context class loader manager get container get loader get class loader thread done false thread start
start the distributor thread
protected void stop thread if thread null return thread done true thread interrupt try thread join catch interrupted exception e thread null
stop the distributor thread
protected void thread sleep try thread sleep interval catch interrupted exception e
little thread sleep awhile
public string get jvm route id string id string sessid null if id null if this get jvm route null if this get jvm route equals id substring id index of 1 id length sessid id substring 0 id index of 1 this get jvm route log debug jvm route id is sessid else return id return sessid
generate new sessionid for a new jvm route during failover
public void end throws exception engine engine engine digester pop object service digester pop embedded catalina embedded digester peek digester push service digester push engine catalina add engine engine
the stack must look like embedded service engine
public void set session cookie http servlet response response string session id if response null if context get cookies set a new session cookie cookie new cookie new cookie globals session cookie name session id log debug setting cookie with session id session id name globals session cookie name new cookie set max age 1 new cookie set path context path response add cookie new cookie
sets a new cookie for the given session id and response
protected void set logger logger log this log log
set the logger for this session
public service context get service context object name service name service context ctx service context name to service map get service name return ctx
lookup the service context for the given service name
public void add session session if session null return is this session of the right type if session instanceof clustered session synchronized sessions add to local store first sessions put session get id session try add to distributed store store session clustered session session catch exception e log error adding a session to the clustered store failed e log debug session with id session get id added else throw new illegal argument exception you can only add clustered sessions to this manager
add session to this manager
protected void init after load cluster manager manager logger log this set manager manager this set logger log debug 0 expiring false listeners new array list notes new hash map support new property change support this notify all attributes of type http session activation listener srv 7 7 2 this activate
initialize fields marked as transient after loading this session
public void remove session session if session null return synchronized sessions try remove from distributed store remove session session get id catch exception e log warn removing a session from the clustered store failed e remove from local store sessions remove session get id log debug session with id session get id removed
removes a session from this manager
protected void remove local session session if session null return synchronized sessions sessions remove session get id
remove a session from the local store only
public boolean are attributes modified serializable http session previous version return true
are attributes modified
public void set domain string catalina home this catalina domain catalina home
the most important atteribute defines the managed domain
protected string get name return get class get name
return a short name for this realm implementation for use in
public void remove local string id if id null return synchronized sessions sessions remove id
remove a session from the local store only
public long get content creation time return this get creation time
get the creation time of this session
protected principal get principal string username return new simple principal username
return the principal associated with the given user name
public boolean get delete work dirs return this delete work dirs
get the delete work dirs on undeployment flag
public void start throws lifecycle exception start manager
start this manager
public void set delete work dirs boolean flag this delete work dirs flag
set the delete work dirs on undeployment flag
public void stop throws lifecycle exception stop manager
stop this manager
public long get content last access time return this get last accessed time
get the last access time for this session
public string get servlet info return a servlet prints the request class loaders
returns a short description of the servlet
public void set snapshot mode string mode this snapshot mode mode
set the snapshot mode
protected void start manager throws lifecycle exception if debug 1 log info starting validate and update our current component state if started throw new lifecycle exception sm get string standard manager already started lifecycle fire lifecycle event start event null started true start the background reaper thread cleanup thread thread start register cluster manager mbean to the mbean server try mbean server server mbean server locator locate elba server register mbean this object name catch exception e log error could not register cluster manager mbean to mbean server e
prepare for the beginning of active use of the public methods of this
public string get snapshot mode return this snapshot mode
get the snapshot mode
protected void stop manager throws lifecycle exception if debug 1 log info stopping validate and update our current component state if started throw new lifecycle exception sm get string standard manager not started lifecycle fire lifecycle event stop event null started false stop the background reaper thread cleanup thread thread stop unregister cluster manager mbean from the mbean server try mbean server server mbean server locator locate elba server unregister mbean object name catch exception e log error could not unregister cluster manager mbean from mbean server e
gracefully terminate the active use of the public methods of this
public void set snapshot interval int interval this snapshot interval interval
set the snapshot interval in milliseconds for snapshot mode interval
public void load throws class not found exception ioexception we do not support persistence for sessions
load persisted sessions not supported by this manager
protected void shutdown services try get the deployed objects from service controller server invoke controller shutdown new object 0 new string 0 catch exception e throwable t jmxexception decoder decode e log error failed to shutdown services t
the code shutdown services code method calls the one and only
public int get snapshot interval return this snapshot interval
get the snapshot interval
public void unload throws ioexception we do not support persistence for sessions
load persisted sessions not supported by this manager
protected void remove mbeans try server unregister mbean service controller mbean object name server unregister mbean server config impl mbean object name server unregister mbean server impl mbean object name catch exception e throwable t jmxexception decoder decode e log error failed to unregister mbeans t try mbean server factory release mbean server server catch exception e throwable t jmxexception decoder decode e log error failed to release mbean server t
the code remove mbeans code method uses the mbean server to unregister
public void run we do our own expire so no code here
overloaded run method of the session cleanup thread
public void set config element config this extended config config
this method is invoked to import an arbitrary xml configuration tree
public void start throws lifecycle exception if super started return super lifecycle fire lifecycle event start event null super started true create a message digest instance for credentials if desired if super digest null try super md message digest get instance super digest catch no such algorithm exception e throw new lifecycle exception super sm get string realm base algorithm digest e
override to allow a single realm to be shared
private string get next id return proxy get session id
get a new session id from the distributed store
public principal authenticate x509 certificate certs simple principal principal null context security ctx get security context if security ctx null return null try get the elba security manager from the enc context authentication manager security mgr authentication manager security ctx lookup security mgr catch naming exception e category error error during authenticate e return principal
return the principal associated with the specified chain of x509