input
stringlengths
10
828
output
stringlengths
5
107
public object name get jaas security manager service return jaas security manager service
get the jaas security manager service value
public void set jaas security manager service final object name jaas security manager service this jaas security manager service jaas security manager service
set the jaas security manager service value
public void set connection factory impl class string connection factory impl class this connection factory impl class connection factory impl class
set the connection factory impl class value
public managed connection factory get managed connection factory return pooling strategy get managed connection factory
managed connection factory is an internal attribute that holds the
public string get connection interface return connection interface
the connection interface attribute holds the connection interface from the ra
public void set state int p state only send a notification if the state really changes if p state m state m state p state now send the event to the jsr 77 listeners m target send notification new notification state management s types m state 2 m target get name 1 system current time millis state changed
sets a new state and if it changed the appropriate
public base connection manager2 get instance return this
describe code get instance code method here
public void set connection interface string connection interface this connection interface connection interface
set the connection interface value
public string get connection impl class return connection impl class
the connection impl class attribute holds the connection impl class from the ra
protected hashtable get parent keys object name p parent return new hashtable
this method can be overwritten by any subclass which must
public void set connection impl class string connection impl class this connection impl class connection impl class
set the connection impl class value
public statistic get statistic string name statistic stat statistic statistics get name return stat
access a statistic by its name
public void add set current
adds a hit to this counter
public void reset iterator iter statistics values iterator while iter has next object next iter next if next instanceof statistic impl statistic impl s statistic impl next s reset
reset all statistic impl objects
public void remove if current 0 set current
removes a hit to this counter
public void reset current 0 high water mark 0 low water mark 0 super reset
resets the statistics to the initial values
public void add statistic string name statistic statistic statistics put name statistic
add or replace statistic in the stats collection
public string get transaction support return transaction support
the transaction support attribute holds the transaction support from the ra
public void add long p time count if p time 0 min time 1 if min time 0 min time p time min time p time min time p time min time max time p time max time p time max time total time p time request rate system current time millis start count
adds a statistic information about the elapsed time an action
public void add set count
adds a hit to this counter
public void reset count 0 min time 0 max time 0 total time 0 request rate 0 super reset
resets the statistics to the initial values
public void remove if count 0 set count
removes a hit to this counter
public void reset count 0 super reset
resets the statistics to the initial values
public void set long count long min time long max time long total time this count count this min time min time this max time max time this total time total time this request rate total time count
set all time statistic values
public void set long count this count count super set
set the current value of the count
public void reset start time system current time millis last sample time start time
reset the last sample time and start time to the current time
public void add range stat add
adds a hit to this counter
public void set last sample time system current time millis
update the last sample time and start time on first call
public void remove range stat remove
removes a hit to this counter
public void reset range stat reset
resets the statistics to the initial values
public void set long current range stat set current
set the current value of the range statistic
public void set transaction support string transaction support this transaction support transaction support
set the transaction support value
public stats get stats try update common stats stats object name pool name get container pool name range statistic impl ready count range statistic impl stats get method ready count integer pool size integer server get attribute pool name current size ready count set pool size long value object name cache name get container cache name range statistic impl passive count range statistic impl stats get passive count long passive long server get attribute cache name passivated count passive count set passive long value catch exception e log debug failed to retrieve stats e return stats
query the ejb container and its mbeans for the bean stats
public element get managed connection factory properties return managed connection factory properties
the managed connection factory properties attribute holds the
protected hashtable get parent keys object name parent name hashtable keys new hashtable hashtable l properties parent name get key property list keys put j2 eeserver j2 ee type l properties get name return keys
extract the name attribute from parent and return j2 eeserver name
public void set managed connection factory properties element managed connection factory properties this managed connection factory properties managed connection factory properties
set the managed connection factory properties value
public stats get stats refresh the stats stats get up time stats get heap size return stats
obtain the stats from the statistics provider
public string get authentication mechanism type return authentication mechanism type
the authentication mechanism type attribute holds the authentication mechanism type from the ra
public void set authentication mechanism type string authentication mechanism type this authentication mechanism type authentication mechanism type
set the authentication mechanism type value
public boolean equals object p test if p test instanceof jmsnotification listener try return m queue get queue name equals jmsnotification listener p test m queue get queue name catch jmsexception e log error unexpcted failure while tetsing equality e return false
test if this and the given object are equal
public string get credential interface return credential interface
the credential interface attribute holds the credential interface from the ra
public void handle notification notification p notification object p handback synchronized m list if m list size m maximum size m list add p notification
handles the given notification by sending this to the remote
public void set credential interface string credential interface this credential interface credential interface
set the credential interface value
public boolean is reauthentication support return reauthentication support
the reauthentication support attribute holds the reauthentication support from the ra
protected void destroy service throws exception object name my name get service name string domain my name get domain object name domain name new object name domain set domain names server query names domain name null log info found domain names size domain mbeans iterator domain iter domain names iterator while domain iter has next try object name name object name domain iter next if name equals my name continue server unregister mbean name catch mbean exception ignore super destroy service
query for all mbeans in this services domain and unregister them
public void set reauthentication support boolean reauthentication support this reauthentication support reauthentication support
set the reauthentication support value
public managed connection factory get mcf instance return mcf
the code get mcf instance code method returns the
public boolean add child cmrbug ejblocal child try collection children get children return children add child catch exception e throw new ejbexception e
describe code add child code method here
public boolean remove child cmrbug ejblocal child try collection children get children return children remove child catch exception e throw new ejbexception e
describe code remove child code method here
protected void stop service mcf null mcf class null
the code stop managed connection factory code method unbinds the connection factory
private void copy ra info throws deployment exception try rarmeta data rar md rarmeta data get server get attribute old rar deployment rarmeta data set display name rar md get display name set managed connection factory class rar md get managed connection factory class set transaction support rar md get transaction support set rar md get properties set auth mech type rar md get auth mech type set reauthentication support rar md get reauthentication support catch exception e throw new deployment exception couldn t get old rar deployment e end of try catch
describe code copy ra info code method here
public void connection error occurred connection event ce try unregister connection ce get connection handle catch exception e ignore it wasn t checked out end of try catch managed connection mc managed connection ce get source return managed connection mc true
may be overridden to e
public object create connection factory throws resource exception return mcf create connection factory
creates a connection factory instance
public void set up throws exception initial context jndi new initial context tx tester home tx tester home jndi lookup commerce tx tester
looks up all of the home interfaces and creates the initial data
public managed connection create managed connection javax security auth subject subject connection request info cx request info throws resource exception return mcf create managed connection subject cx request info
creates a new managed connection
public boolean equals object other return mcf equals other
tests object for equality
public int hash code return mcf hash code
generates a hash code for this object
public void set log writer java io print writer out throws resource exception mcf set log writer out
sets the logwriter for this instance
public string to string return management
describes the instance and its content for debugging purpose
protected void stop service
remove the farm deployment directory from the scanner
private void log exception throwable e throwable t org elba mx util jmxexception decoder decode e log error operation failed t
go through the myriad of nested jmx exception to pull out the true
public map get property map map result new hash map set children get children for iterator i children iterator i has next child local c child local i next result put c get name c get value return result
get a map of child values
public void test relations throws exception m target get thread count get log info test relations started count m target for int i 0 i m target i thread thread new thread new cmrtest parent pk get iteration count cmrtest thread i thread start get log info started thread thread wait for completion get log info test relations finished
launch threads which access the cmr collection of the parent bean created below
public void add child int k string field1 string field2 throws create exception ms log debug adding child with pk k try get children add child util get local home create integer to string k field1 field2 catch naming exception e throw new ejbexception e
adds a child bean with the given attributes to this bean
public string ejb create string id string name string value throws javax ejb create exception ms log debug created with pk id set id id set name name set value value return null
create method for entity
public string ejb create string id throws javax ejb create exception ms log debug created id set id id return null
create method for entity
public string get class loader return this get class get class loader to string
describe code get class loader code method here
public void test unpacked ejb jar throws exception deploy unpacked eardeployment ear try session ahome a home session ahome get initial context lookup eardeployment session a session bhome b home session bhome get initial context lookup eardeployment session b session a a a home create session b b b home create assert true a call b failed a call b assert true b call a failed b call a finally undeploy unpacked eardeployment ear
test that an unpacked ejb jar is deployed
public void test ear subpackage visibility throws exception session ahome a home session ahome get initial context lookup eardeployment session a session bhome b home session bhome get initial context lookup eardeployment session b session a a a home create session b b b home create assert true a call b failed a call b assert true b call a failed b call a
the code test ear subpackage visibility code method tests if the classes in
public void test ear jar manifest throws exception get log info test ear jar manifest deploy cpmanifest ear object home get initial context lookup concrete get log info found concrete home home undeploy cpmanifest ear
test that an ear with the following structure
public void test circular manifest throws exception get log info test circular manifest deploy cpcircular manifest ear object home get initial context lookup concrete get log info found concrete home home undeploy cpcircular manifest ear
test that an ear with the following structure
public void test sarmanifest throws exception get log info test sarmanifest deploy external ear object name service name new object name test name external class boolean is registerd get server is registered service name assert true external class service is registered is registerd undeploy external ear
test that an ear with the following structure
public void test ejbjar manifest throws exception get log info test ejbjar manifest deploy cpejbs manifest ear object name ejb1 name new object name elba j2ee service ejb jndi name eardeployment session a boolean is registerd get server is registered ejb1 name assert true eardeployment session a is registered is registerd object name ejb2 name new object name elba j2ee service ejb jndi name eardeployment session b is registerd get server is registered ejb2 name assert true eardeployment session b is registered is registerd undeploy cpejbs manifest ear
test that an ear with the following structure
public void test user xmbean values throws exception get log info test user xmbean values try object name user2 name1 new object name elba test service xmbean user2 version values1 rmiadaptor server get server deploy user2 xmbean sar get log info testing user2 name1 assert true user2 name1 is registered server is registered user2 name1 string value string server get attribute user2 name1 attr1 assert true value att1 initial value value value value equals att1 initial value finally undeploy user2 xmbean sar
tests of the attribute value settings from the xmbean descriptor
public collection get phone numbers return numbers
describe code get phone numbers code method here
public void set phone numbers collection numbers this numbers clear this numbers add all numbers
describe code set phone numbers code method here
public string print info return user get name n address get address n phone numbers numbers
describe code print info code method here
public void add phone number string number numbers add number
describe code add phone number code method here
public void remove phone number string number numbers remove number
describe code remove phone number code method here
public boolean call b try session bhome bhome session bhome new initial context lookup eardeployment session b session b b bhome create b do nothing return true catch exception e logger get logger get class error error in call b e return false end of try catch
describe code call b code method here
public boolean call a try session ahome ahome session ahome new initial context lookup eardeployment session a session a a ahome create a do nothing return true catch exception e logger get logger get class error error in call a e return false
describe code call a code method here
public void test ddentity refs throws exception string test url entityref sar get log debug test url is test url deploy sar deploy test url check deployment registered expected mbeans object name name new object name test name entity ref test assert true test name entity ref test is registered after deploy check state name running undeploy test url
test that a sar deployment descriptor that
public void test file io throws exception log debug test file io iosession bean get iosession try this should fail because the bean calls file exists bean read nofile txt do fail was able to call iosession read catch exception e log debug iosession read failed as expected e try this should fail because the bean calls file exists bean write nofile txt do fail was able to call iosession write catch exception e log debug iosession write failed as expected e bean remove
test that a bean cannot access the filesystem using java
public void test file io throws exception log debug test file io iostateless session bean bean get iosession try this should fail because the bean calls file exists bean read nofile txt do fail was able to call iosession read catch exception e log debug iosession read failed as expected e try this should fail because the bean calls file exists bean write nofile txt do fail was able to call iosession write catch exception e log debug iosession write failed as expected e
test that a bean cannot access the filesystem using java
public void test default pkg service throws exception string test url defaultpkg sar get log debug test url is test url deploy sar deploy test url check deployment registered expected mbeans object name name new object name test name default pkg service assert true test name default pkg service is registered after deploy check state name running undeploy test url
test that a sar deployment that has its service class in the default
public void test server found throws exception log debug test server found
we dont use the elba server so nullify this test
public void rename thread log debug rename thread thread t thread current thread t set name hijacked name log debug renamed current thread
this will only be disallowed if the current thread belongs to the
public void use reflection log debug use reflection try field secret system class get declared field secret object value secret get null catch no such field exception e catch illegal access exception e log debug search for system secret did not fail with a security exception
this test will only fail if reflection is used on a class that
public void test single bean throws exception get log debug spawning nb threads threads for iterations iterations with single bean call task prototype new task main processing method for the enterprise entity test object param name description of parameter param i description of parameter exception exception description of exception public void run string name int i throws exception entity set field name i i run prototype
a unit test for junit
public void run string name int i throws exception entity set field name i i
main processing method for the enterprise entity test object
public void test b2 b throws exception get log debug spawning nb threads threads for iterations iterations with bean to bean call entity set next entity daniel task prototype new task main processing method for the enterprise entity test object param name description of parameter param i description of parameter exception exception description of exception public void run string name int i throws exception entity set and copy field name i i run prototype
a unit test for junit
protected void set up throws exception try create catch exception e get log error setup error in create e throw e
the junit setup method
public void run string name int i throws exception entity set and copy field name i i
main processing method for the enterprise entity test object
protected void tear down throws exception try remove catch exception e get log error teardown error in remove e throw e
the teardown method for junit
protected void set up throws exception nb threads get thread count default thread count iterations get iteration count default iterations get log debug setting up get class get name test get name enterprise entity home home enterprise entity home get initial context lookup jndiname try entity home find by primary key seb catch finder exception e entity home create seb setup the threads threads new worker nb threads
the junit setup method
protected void start all task prototype throws exception completed threads 0 for int i 0 i nb threads i task task task prototype clone threads i new worker thread i 1 task get log threads i start
description of the method
protected void join all throws exception wait for all the threads to finish for int i 0 i nb threads i threads i join
description of the method
protected void run task prototype throws exception start all prototype join all assert true failed
main processing method for the enterprise entity test object
protected boolean has failed return failed
description of the method
public void run long start system current time millis int i for i 0 i iterations i if running has failed break try task run name i log debug name i 1 iterations done catch throwable t log error name caught an exception dying t t print stack trace running false set failed synchronized this completed threads long end system current time millis log debug name did i iterations in end start ms complete completed threads
main processing method for the worker object