input
stringlengths
10
828
output
stringlengths
5
107
public void set idle timeout long millis if objects null throw new illegal state exception initialized idle timeout millis millis
sets the minimum idle time to release an unused object from the pool
public void set gcmin idle time long millis if objects null throw new illegal state exception initialized gc min idle millis millis
sets the minimum idle time to make an object eligible for garbage
public void set cleanup interval long millis if objects null throw new illegal state exception initialized cleanup interval millis millis
sets the length of time between garbage collection and idle timeout runs
protected boolean query mbean object name object name query exp query exp if query exp null return true try return query exp apply object name catch exception e todo is this correct return false
query an mbean against the query
public void deploy final url url throws deployment exception deployer deploy url
deploys the given url on the remote server
public void deploy final string url throws malformed urlexception deployment exception deployer deploy strings to url url
deploys the given url on the remote server
public void undeploy final url url throws deployment exception deployer undeploy url
undeploys the application specifed by the given url on the remote server
public void undeploy final string url throws malformed urlexception deployment exception deployer undeploy strings to url url
undeploys the application specifed by the given url on the remote server
public boolean is deployed final url url return deployer is deployed url
check if the given url is deployed on thr remote server
public void set blocking timeout long blocking timeout this blocking timeout blocking timeout
sets how long to wait for a free object when blocking 1 indicating
public boolean is deployed final string url throws malformed urlexception return deployer is deployed strings to url url
check if the given url is deployed on thr remote server
public void set timestamp used boolean timestamp if objects null throw new illegal state exception initialized track last used timestamp
sets whether object clients can update the last used time
public void set invalidate on error boolean invalidate if objects null throw new illegal state exception initialized invalidate on error invalidate
sets the response for object errors
public string get legacy jndi name if name null return jmx name host protocol name name else return jmx name host protocol name
the legacy hard coded name
public void test get role cardinality external throws exception mbean server server mbean server factory create mbean server try object name service create relation service test type service server create relation type c service create roles c server integer result null relation support support null support new relation support id service server relation type c roles c add relation server service support test type support result support get role cardinality role c1 assert equals 2 result int value result support get role cardinality role c2 assert equals 3 result int value finally mbean server factory release mbean server server
test get role cardinality
protected void process nested deployments deployment info di
override the default behavior of looking into the archive for deployables
public boolean equals object another return false
this method always returns 0 to indicate equality for any argument
public boolean equals object another if another instanceof principal return false string another name principal another get name boolean equals false if name null equals another name null else equals name equals another name return equals
compare this simple principals name against another principal
public string get security domain return security domain
get the name of the security domain associated with this security mgr
public subject get active subject return null
get the currently authenticated subject
public boolean is valid principal principal object credential return true
validate that the given credential is correct for principal
public string get login config return login config name
get the name of the mbean that provides the default jaas login configuration
public principal get principal principal principal principal result principal return result
always returns the argument principal
public void set login config string name throws malformed object name exception this login config name name
set the name of the mbean that provides the default jaas login configuration
public boolean does user have role principal principal set role names boolean has role true return has role
does the current subject have a role a principal that equates to one
public void start service throws exception push login config login config name
start the configuration service by pushing the mbean given by the
public set get user roles principal principal hash set roles new hash set roles add anybody principal anybody principal return roles
return the set of domain roles the principal has been assigned
public void stop service throws exception if login config stack empty false pop login config
start the configuration service by poping the top of the
private boolean authenticate principal principal object credential boolean authenticated true return authenticated
authenticate principal against credential
public void set as text final string text simple principal principal new simple principal text set value principal
build a simple principal
public string get auth config return auth config
get the resource path to the jaas login configuration file to use
public configuration get configuration configuration current config if the config null the config configuration get configuration log debug the config set to the config return the config
return the configuration instance managed by this mbean
public boolean equals object another return true
this method always returns 0 to indicate equality for any argument
public void set pool name final string name this name name
set the pool name
public string get pool name return name
get the pool name
public void set pool factory class final string classname this pool factory class classname
set the classname of pool factory to use
public string get pool factory class return pool factory class
get the classname of pool factory to use
public void set xid factory final object name xid factory this xid factory xid factory
set the value of xid factory
public boolean is gcenabled return gcenabled
gets whether garbage collection is enabled
public void set xid factory final xid factory mbean xid factory this xid factory xid factory
the code set xid factory code method supplies the xid factory that
protected void stop service unbind from jndi initial context ctx null try ctx new initial context string name pool factory get name string jndiname java name ctx unbind jndiname non serializable factory unbind jndiname if log is info enabled log info pool factory name unbound from jndiname catch naming exception ignore finally if ctx null try ctx close catch naming exception ignore
stop the service
public session get session throws jmsexception if xa session null return xa session else return session
returns the session
public xid factory mbean get xid factory return xid factory
the code get xid factory code method returns the xid factory that
public server session get server session throws jmsexception if log is trace enabled log trace getting a server session server session session null try while true synchronized session pool if closing throw new jmsexception cannot get session after pool has been closed down else if session pool size 0 session server session session pool remove 0 break else try session pool wait catch interrupted exception ignore catch exception e throw new jmsexception failed to get a server session e assert session null if log is trace enabled log trace using server session session return session
get a server session
public void run boolean trace log is trace enabled if trace log trace running try if xa session null xa session run else session run finally if trace log trace recycling recycle if trace log trace finished run
runs in an own thread basically calls the session
public void set provider url final string url this provider url url
set the url that will be used to connect to the jndi provider
public thread new thread final runnable command string name thread pool worker next count return new thread thread group command name
create a new thread for the given runnable
public void start throws jmsexception log trace starting invokes on server session if session null try server session pool get executor execute this catch interrupted exception ignore else throw new jmsexception no listener has been specified
start the session and begin consuming messages
public long get cleanup interval return cleanup interval millis
gets the length of time between garbage collection and idle timeout runs
public void test has relation errors throws exception relation service rs new relation service true boolean caught false try rs has relation null catch illegal argument exception e caught true if caught false fail has relation allows null relation id
test has relation errors
public input stream get resource as stream string name class loader cl get target class loader if cl null return super get system resource as stream name return cl get resource as stream name
delegate to the original class loader
public url get resource string name class loader cl get target class loader if cl null return super get system resource name return cl get resource name
delegate to the original class loader
public long get blocking timeout return this blocking timeout
get how long this pool will wait for a free object while blocking
public method create get invocation handler method gen mg new method gen constants acc public invocation handler t type no args null get invocation handler mn proxy class name il const pool il append i factory create load proxy class t 0 il append i factory create get field proxy class name invocation handler fn invocation handler t il append i factory create return invocation handler t mg strip attributes true mg set max stack mg set max locals return get method and tidyup mg
generate an implementation of
public field create invocation handler field field gen fg new field gen constants acc private invocation handler t invocation handler fn const pool return fg get field
generate a field declaration of the form
public field create runtime field field gen fg new field gen constants acc public constants acc static runtime t runtime runtime fn const pool return fg get field
generate a field declaration of the form
public void initialize if factory null pool name null throw new illegal state exception factory and name must be set before pool initialization if objects null throw new illegal state exception cannot initialize more than once dead objects new hash set objects new hash map factory pool started this last cleanup system current time millis int max max size 0 min size math min min size max size for int i 0 i max i create new object null false collector add pool this
prepares the pool for use
private method get method and tidyup final method gen mg method m mg get method il dispose return m
a helper to return the method from method gen and clean up the
public void test is relation errors throws exception relation service rs new relation service true boolean caught false try rs is relation null catch illegal argument exception e caught true if caught false fail is relation allows null relation id
test is relation errors
public void shut down collector remove pool this factory pool closing this hash map local objects objects objects null close all objects for iterator it local objects values iterator it has next object record rec object record it next if rec is in use factory return object rec get client object factory delete object rec get object rec close local objects clear factory null pool name null
shuts down the pool
public void mark object as invalid object object if dead objects null throw new illegal state exception tried to use pool before it was initialized or after it was shut down dead objects add object
indicates that an object is no longer valid and should be removed from
public void test is relation mbean errors throws exception relation service rs new relation service true boolean caught false try rs is relation mbean null catch illegal argument exception e caught true if caught false fail is relation mbean allows null relation id caught false try rs is relation mbean rubbish catch relation not found exception e caught true if caught false fail is relation mbean allows non existent relation
test is relation mbean errors
public class get home interface class return home
obtain the class object for the enterprise beans home interface
public class get remote interface class return remote
obtain the class object for the enterprise beans remote interface
public boolean is session return session
test if the enterprise beans type is session
public boolean is stateless session return stateless session
test if the enterprise beans type is stateless session
public ejbhome get ejbhome throws remote exception try initial context ic null if jndi env null ic new initial context jndi env else ic new initial context ejbhome home ejbhome ic lookup jndi name return home catch naming exception e throw new server exception could not get ejbhome e
home handle implementation
public object invoke invocation mi throws throwable method m mi get method string method name m get name invoker proxy mi get invocation context get invoker implement local methods if method name equals to string return proxy to string if method name equals equals object args mi get arguments string this string proxy to string string args string args 0 null args 0 to string return new boolean this string equals args string if method name equals hash code return integer mi get object name return get next invoke mi
handle methods locally on the client
public interceptor set next final interceptor interceptor assert interceptor null next interceptor interceptor return interceptor
set the next interceptor in the chain
public void start throws exception setup invokers bind proxy
become fully available
protected void setup invokers throws exception object name oname new object name invoker meta data get invoker mbean invoker invoker invoker registry lookup oname if invoker null throw new runtime exception invoker is null oname home invoker bean invoker invoker
lookup the invokers in the object registry
private void remove object object pooled synchronized resize lock objects remove pooled
removes an object from the pool
public object get stateless session ejbobject return stateless object
return the ejbobject proxy for stateless sessions
private void check threshold number number assert equals number counter monitor monitor get threshold
check a counters threshold
public void test send relation creation notification errors throws exception relation service rs new relation service true boolean caught false try rs send relation creation notification null catch illegal argument exception e caught true if caught false fail send relation creation notification allows null relation id caught false try rs send relation creation notification rubbish catch relation not found exception e caught true if caught false fail send relation creation notification allows invalid relation id
test send relation removal notification errors
private void init string monitor boolean differ boolean match string compare try string monitor string monitor new string monitor string monitor set notify differ differ string monitor set notify match match string monitor set string to compare compare string support support new string support monitor string monitor monitored support init monitor catch exception e fail e to string
create a string monitor
public void test send relation removal notification errors throws exception relation service rs new relation service true boolean caught false try rs send relation removal notification null new array list catch illegal argument exception e caught true if caught false fail send relation removal notification allows null relation id caught false try rs send relation removal notification rubbish new array list catch relation not found exception e caught true if caught false fail send relation removal notification allows invalid relation id
test send relation removal notification errors
private void init monitor throws exception monitor name new object name test type monitor monitored name new object name test type monitored monitor set observed object monitored name monitor set observed attribute value monitor set granularity period monitor suite granularity time server register mbean monitor monitor name server register mbean monitored monitored name server add notification listener monitor name this null null
create the monitor
private void stop monitor if monitor null monitored end monitor stop
stop the monitor
public void handle notification notification n object ignored synchronized notifications notifications add n notifications notify all
handle the notification just add it to the list
private void wait cycle monitored unlock set monitored lock set
wait one cycle of the monitor
public void check session session meta data session boolean bean verified false boolean home verified false boolean remote verified false bean verified verify session bean session home verified verify session home session remote verified verify session remote session if bean verified home verified remote verified verification for this session bean done fire the event to tell listeneres everything is ok fire bean verified event session
verifies the session bean class home interface and remote interface
public void verify url url application meta data meta data verify url meta data null
checks the enterprise java beans found in this jar for ejb spec
private number add object value1 object value2 if value1 instanceof byte return new byte byte byte value1 byte value byte value2 byte value if value1 instanceof integer return new integer integer value1 int value integer value2 int value if value1 instanceof short return new short short short value1 short value short value2 short value if value1 instanceof long return new long long value1 long value long value2 long value fail you idiot return null
add two numbers
public void check entity entity meta data entity boolean pk verified false boolean bean verified false boolean home verified false boolean remote verified false bean verified verify entity bean entity home verified verify entity home entity remote verified verify entity remote entity pk verified verify primary key entity if bean verified home verified remote verified pk verified verification for this entity bean done fire the event to tell listeneres everything is ok fire bean verified event entity
verifies the entity bean class home interface remote interface and
private number sub object value1 object value2 if value1 instanceof byte return new byte byte byte value1 byte value byte value2 byte value if value1 instanceof integer return new integer integer value1 int value integer value2 int value if value1 instanceof short return new short short short value1 short value short value2 short value if value1 instanceof long return new long long value1 long value long value2 long value fail you idiot return null
subtract two numbers
public string get section token int index if section length index throw new index out of bounds exception get section index error return section index
returns the section number by index
public string get section string buffer buffer new string buffer for int i 0 i section length i buffer append section i if i 1 section length buffer append return buffer to string
returns the section string
public string to string if info null return get section info else return get section
string representation of this object
public boolean has single argument method method class arg class class params method get parameter types if params length 1 if params 0 equals arg class return true return false
checks if the method accepts a single parameter of a specified type
protected boolean verify bean bean meta data the bean string bean name the bean get ejb class if bean name null return false try bean classloader load class bean name return true catch class not found exception cnfe fire spec violation event the bean new section 22 2 b class not found bean name return false
try to load the beans class declared in the lt ejb class gt
public boolean has no arguments method method class params method get parameter types return params length 0 true false
checks if the method accepts any parameters
public boolean throws no exception method method boolean has checked exception false class exceptions method get exception types for int e 0 e exceptions length e class ex exceptions e boolean is error error class is assignable from ex boolean is runtime exception runtime exception class is assignable from ex if is error false is runtime exception false has checked exception true return has checked exception false
checks if the method throws no checked exceptions in its throws clause
public boolean throws create exception method method class exception method get exception types for int i 0 i exception length i if is assignable from javax ejb create exception exception i return true return false
checks if the method includes java
public void unreferenced log debug lost connection to user transaction client if active tx is empty log error lost connection to user transaction clients rolling back active tx size active transaction s collection txs active tx values iterator iter txs iterator while iter has next transaction tx transaction iter next try tx rollback catch exception ex log error rollback failed ex
when no longer referenced be sure to rollback any
public boolean throws finder exception method method class exception method get exception types for int i 0 i exception length i if is assignable from javax ejb finder exception exception i return true return false
checks if the methods includes javax
public string get jndi name return context info get jndi name
set the jndi name under which the external context is bound
public boolean is create method method m return m get name starts with create method
check whether the given method is a create
public void set jndi name string jndi name throws naming exception context info set jndi name jndi name if super get state started unbind jndi name try rebind catch exception e naming exception ne new naming exception failed to update jndi name ne set root cause e throw ne
set the jndi name under which the external context is bound
public object get object instance object obj name name context name ctx hashtable env throws exception get the nns value from the reference obj and use it as the map key reference ref reference obj ref addr addr ref get nns string key string addr get content object target wrapper map get key return target
transform the obj reference bound into the jndi namespace into the