idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
14,700
public Map < String , String > getUriVariablesForEntityDelete ( BullhornEntityInfo entityInfo , Integer id ) { Map < String , String > uriVariables = new LinkedHashMap < String , String > ( ) ; addModifyingUriVariables ( uriVariables , entityInfo ) ; uriVariables . put ( ID , id . toString ( ) ) ; return uriVariables ; }
Returns the uri variables needed for an entity DELETE
92
12
14,701
public Map < String , String > getUriVariablesForEntityInsert ( BullhornEntityInfo entityInfo ) { Map < String , String > uriVariables = new LinkedHashMap < String , String > ( ) ; addModifyingUriVariables ( uriVariables , entityInfo ) ; return uriVariables ; }
Returns the uri variables needed for the entity PUT request .
72
13
14,702
public Map < String , String > getUriVariablesForQueryWithPost ( BullhornEntityInfo entityInfo , Set < String > fieldSet , QueryParams params ) { Map < String , String > uriVariables = params . getParameterMap ( ) ; this . addCommonUriVariables ( fieldSet , entityInfo , uriVariables ) ; return uriVariables ; }
Returns the uri variables needed for a query request minus where since that will be in the body
84
19
14,703
public Map < String , String > getUriVariablesForQuery ( BullhornEntityInfo entityInfo , String where , Set < String > fieldSet , QueryParams params ) { Map < String , String > uriVariables = params . getParameterMap ( ) ; this . addCommonUriVariables ( fieldSet , entityInfo , uriVariables ) ; uriVariables . put ( WHERE , where ) ; return uriVariables ; }
Returns the uri variables needed for a query request
97
10
14,704
public Map < String , String > getUriVariablesForSearchWithPost ( BullhornEntityInfo entityInfo , Set < String > fieldSet , SearchParams params ) { Map < String , String > uriVariables = params . getParameterMap ( ) ; this . addCommonUriVariables ( fieldSet , entityInfo , uriVariables ) ; return uriVariables ; }
Returns the uri variables needed for a search request minus query
84
12
14,705
public Map < String , String > getUriVariablesForSearch ( BullhornEntityInfo entityInfo , String query , Set < String > fieldSet , SearchParams params ) { Map < String , String > uriVariables = params . getParameterMap ( ) ; this . addCommonUriVariables ( fieldSet , entityInfo , uriVariables ) ; uriVariables . put ( QUERY , query ) ; return uriVariables ; }
Returns the uri variables needed for a search request
98
10
14,706
public Map < String , String > getUriVariablesForIdSearch ( BullhornEntityInfo entityInfo , String query , SearchParams params ) { Map < String , String > uriVariables = params . getParameterMap ( ) ; uriVariables . put ( BH_REST_TOKEN , bullhornApiRest . getBhRestToken ( ) ) ; uriVariables . put ( ENTITY_TYPE , entityInfo . getName ( ) ) ; uriVariables . put ( QUERY , query ) ; return uriVariables ; }
Returns the uri variables needed for a id search request
123
11
14,707
public Map < String , String > getUriVariablesForResumeFileParse ( ResumeFileParseParams params , MultipartFile resume ) { if ( params == null ) { params = ParamFactory . resumeFileParseParams ( ) ; } Map < String , String > uriVariables = params . getParameterMap ( ) ; String bhRestToken = bullhornApiRest . getBhRestToken ( ) ; uriVariables . put ( BH_REST_TOKEN , bhRestToken ) ; uriVariables . put ( FORMAT , restFileManager . getFileParam ( resume ) ) ; return uriVariables ; }
Returns the uri variables needed for a resume file request
147
11
14,708
public Map < String , String > getUriVariablesForResumeTextParse ( ResumeTextParseParams params ) { if ( params == null ) { params = ParamFactory . resumeTextParseParams ( ) ; } Map < String , String > uriVariables = params . getParameterMap ( ) ; String bhRestToken = bullhornApiRest . getBhRestToken ( ) ; uriVariables . put ( BH_REST_TOKEN , bhRestToken ) ; return uriVariables ; }
Returns the uri variables needed for a resume text request
119
11
14,709
public Map < String , String > getUriVariablesForGetFile ( BullhornEntityInfo entityInfo , Integer entityId , Integer fileId ) { Map < String , String > uriVariables = new LinkedHashMap < String , String > ( ) ; String bhRestToken = bullhornApiRest . getBhRestToken ( ) ; uriVariables . put ( BH_REST_TOKEN , bhRestToken ) ; uriVariables . put ( ENTITY_TYPE , entityInfo . getName ( ) ) ; uriVariables . put ( ENTITY_ID , entityId . toString ( ) ) ; uriVariables . put ( FILE_ID , fileId . toString ( ) ) ; return uriVariables ; }
Returns the uri variables needed for a get file request
167
11
14,710
public Map < String , String > getUriVariablesForCorpNotes ( Integer clientCorporationID , Set < String > fieldSet , CorpNotesParams params ) { if ( params == null ) { params = ParamFactory . corpNotesParams ( ) ; } Map < String , String > uriVariables = params . getParameterMap ( ) ; String bhRestToken = bullhornApiRest . getBhRestToken ( ) ; uriVariables . put ( BH_REST_TOKEN , bhRestToken ) ; String fields = this . convertFieldSetToString ( fieldSet ) ; uriVariables . put ( FIELDS , fields ) ; uriVariables . put ( CLIENT_CORP_ID , clientCorporationID . toString ( ) ) ; return uriVariables ; }
Returns the uri variables needed for a get corp notes call
180
12
14,711
private void addModifyingUriVariables ( Map < String , String > uriVariables , BullhornEntityInfo entityInfo ) { String bhRestToken = bullhornApiRest . getBhRestToken ( ) ; uriVariables . put ( BH_REST_TOKEN , bhRestToken ) ; uriVariables . put ( ENTITY_TYPE , entityInfo . getName ( ) ) ; uriVariables . put ( EXECUTE_FORM_TRIGGERS , bullhornApiRest . getExecuteFormTriggers ( ) ? "true" : "false" ) ; }
Adds common URI Variables for calls that are creating updating or deleting data .
136
15
14,712
public Map < String , String > getUriVariablesForFastFind ( String query , FastFindParams params ) { Map < String , String > uriVariables = params . getParameterMap ( ) ; uriVariables . put ( BH_REST_TOKEN , bullhornApiRest . getBhRestToken ( ) ) ; uriVariables . put ( QUERY , query ) ; return uriVariables ; }
Returns the uri variables needed for a fastFind request
96
11
14,713
protected < C extends CrudResponse , T extends UpdateEntity > List < C > handleMultipleUpdates ( List < T > entityList ) { if ( entityList == null || entityList . isEmpty ( ) ) { return Collections . emptyList ( ) ; } List < EntityUpdateWorker < C > > taskList = new ArrayList < EntityUpdateWorker < C > > ( ) ; for ( T entity : entityList ) { taskList . add ( new EntityUpdateWorker < C > ( this , entity ) ) ; } return concurrencyService . spinThreadsAndWaitForResult ( taskList ) ; }
Spins off threads that will call handleUpdateEntity for each entity .
131
14
14,714
protected < P extends ParsedResume > P handleParseResumeText ( String resume , ResumeTextParseParams params ) { Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesForResumeTextParse ( params ) ; String url = restUrlFactory . assembleParseResumeTextUrl ( params ) ; JSONObject resumeInfoToPost = new JSONObject ( ) ; try { resumeInfoToPost . put ( "resume" , resume ) ; } catch ( JSONException e ) { log . error ( "Error creating JsonObject with resume text." , e ) ; } String jsonEncodedResume = resumeInfoToPost . toString ( ) ; ParsedResume response = this . parseResume ( url , jsonEncodedResume , uriVariables ) ; return ( P ) response ; }
Handles the parsing of a resume text . Contains retry logic .
188
14
14,715
protected ParsedResume parseResume ( String url , Object requestPayLoad , Map < String , String > uriVariables ) { ParsedResume response = null ; for ( int tryNumber = 1 ; tryNumber <= RESUME_PARSE_RETRY ; tryNumber ++ ) { try { response = this . performPostResumeRequest ( url , requestPayLoad , uriVariables ) ; break ; } catch ( HttpStatusCodeException error ) { response = handleResumeParseError ( tryNumber , error ) ; } catch ( Exception e ) { log . error ( "error" , e ) ; } } return response ; }
Makes the call to the resume parser . If parse fails this method will retry RESUME_PARSE_RETRY number of times .
138
29
14,716
protected List < FileWrapper > handleGetAllFileContentWithMetaData ( Class < ? extends FileEntity > type , Integer entityId ) { List < FileMeta > metaDataList = this . handleGetEntityMetaFiles ( type , entityId ) ; // Create an ExecutorService with the number of processors available to the Java virtual machine. ExecutorService executor = Executors . newFixedThreadPool ( Runtime . getRuntime ( ) . availableProcessors ( ) ) ; // First get all the FileContent List < Future < FileContent > > futureList = new ArrayList < Future < FileContent > > ( ) ; for ( FileMeta metaData : metaDataList ) { FileWorker fileWorker = new FileWorker ( entityId , metaData . getId ( ) , type , this ) ; Future < FileContent > fileContent = executor . submit ( fileWorker ) ; futureList . add ( fileContent ) ; } Map < Integer , FileContent > fileContentMap = new HashMap < Integer , FileContent > ( ) ; for ( Future < FileContent > future : futureList ) { try { fileContentMap . put ( future . get ( ) . getId ( ) , future . get ( ) ) ; } catch ( InterruptedException e ) { log . error ( "Error in bullhornapirest.getAllFileContentWithMetaData" , e ) ; } catch ( ExecutionException e ) { log . error ( "Error in bullhornapirest.getAllFileContentWithMetaData" , e ) ; } } // shutdown pool, wait until it's done executor . shutdown ( ) ; while ( ! executor . isTerminated ( ) ) { } // null it out executor = null ; // Second create the FileWrapper list from the FileContent and FileMeta List < FileWrapper > fileWrapperList = new ArrayList < FileWrapper > ( ) ; for ( FileMeta metaData : metaDataList ) { FileContent fileContent = fileContentMap . get ( metaData . getId ( ) ) ; FileWrapper fileWrapper = new StandardFileWrapper ( fileContent , metaData ) ; fileWrapperList . add ( fileWrapper ) ; } return fileWrapperList ; }
This method will get all the meta data and then handle the fetching of FileContent in a multi - threaded fashion .
478
24
14,717
protected FileWrapper handleGetFileContentWithMetaData ( Class < ? extends FileEntity > type , Integer entityId , Integer fileId ) { FileWrapper fileWrapper = null ; try { FileContent fileContent = this . handleGetFileContent ( type , entityId , fileId ) ; List < FileMeta > metaDataList = this . handleGetEntityMetaFiles ( type , entityId ) ; FileMeta correctMetaData = null ; for ( FileMeta metaData : metaDataList ) { if ( fileId . equals ( metaData . getId ( ) ) ) { correctMetaData = metaData ; break ; } } fileWrapper = new StandardFileWrapper ( fileContent , correctMetaData ) ; } catch ( Exception e ) { log . error ( "Error getting file with id: " + fileId + " for " + type . getSimpleName ( ) + " with id:" + entityId ) ; } return fileWrapper ; }
Makes the api call to get both the file content and filemeta data and combines those two to a FileWrapper
202
24
14,718
protected List < FileMeta > handleGetEntityMetaFiles ( Class < ? extends FileEntity > type , Integer entityId ) { Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesForGetEntityMetaFiles ( BullhornEntityInfo . getTypesRestEntityName ( type ) , entityId ) ; String url = restUrlFactory . assembleGetEntityMetaFilesUrl ( ) ; String jsonString = this . performGetRequest ( url , String . class , uriVariables ) ; EntityMetaFiles < ? extends FileMeta > entityMetaFiles = restJsonConverter . jsonToEntityDoNotUnwrapRoot ( jsonString , StandardEntityMetaFiles . class ) ; if ( entityMetaFiles == null || entityMetaFiles . getFileMetas ( ) == null ) { return Collections . emptyList ( ) ; } return ( List < FileMeta > ) entityMetaFiles . getFileMetas ( ) ; }
Makes the api call to get the FileMeta data for an entity
202
14
14,719
protected FileContent handleGetFileContent ( Class < ? extends FileEntity > type , Integer entityId , Integer fileId ) { Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesForGetFile ( BullhornEntityInfo . getTypesRestEntityName ( type ) , entityId , fileId ) ; String url = restUrlFactory . assembleGetFileUrl ( ) ; String jsonString = this . performGetRequest ( url , String . class , uriVariables ) ; FileContent fileContent = restJsonConverter . jsonToEntityUnwrapRoot ( jsonString , StandardFileContent . class ) ; fileContent . setId ( fileId ) ; return fileContent ; }
Makes the api call to get the file content
154
10
14,720
protected FileWrapper handleAddFileWithMultipartFile ( Class < ? extends FileEntity > type , Integer entityId , MultipartFile multipartFile , String externalId , FileParams params , boolean deleteFile ) { MultiValueMap < String , Object > multiValueMap = null ; try { multiValueMap = restFileManager . addFileToMultiValueMap ( multipartFile ) ; } catch ( IOException e ) { log . error ( "Error creating temp file" , e ) ; } Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesForAddFile ( BullhornEntityInfo . getTypesRestEntityName ( type ) , entityId , externalId , params ) ; String url = restUrlFactory . assembleAddFileUrl ( params ) ; return this . handleAddFile ( type , entityId , multiValueMap , url , uriVariables , multipartFile . getOriginalFilename ( ) , deleteFile ) ; }
Makes the api call to add files to an entity . Takes a MultipartFile .
210
19
14,721
protected FileWrapper handleAddFileAndUpdateCandidateDescription ( Integer candidateId , File file , String candidateDescription , String externalId , FileParams params , boolean deleteFile ) { // first add the file FileWrapper fileWrapper = this . handleAddFileWithFile ( Candidate . class , candidateId , file , externalId , params , deleteFile ) ; // second update the candidate try { Candidate candidateToUpdate = new Candidate ( ) ; candidateToUpdate . setId ( candidateId ) ; if ( ! StringUtils . isBlank ( candidateDescription ) ) { candidateToUpdate . setDescription ( candidateDescription ) ; this . updateEntity ( candidateToUpdate ) ; } } catch ( Exception e ) { log . error ( "Error reading file to resume text" , e ) ; } return fileWrapper ; }
Handles logic to add the file to the candidate entity AND updating the candidate . description with the resume text .
172
22
14,722
protected < P extends ParsedResume > P addFileThenHandleParseResume ( Class < ? extends FileEntity > type , Integer entityId , MultipartFile multipartFile , String externalId , FileParams fileParams , ResumeFileParseParams params ) { FileWrapper fileWrapper = handleAddFileWithMultipartFile ( type , entityId , multipartFile , externalId , fileParams , true ) ; P parsedResume = this . handleParseResumeFile ( multipartFile , params ) ; if ( ! parsedResume . isError ( ) ) { parsedResume . setFileWrapper ( fileWrapper ) ; } return parsedResume ; }
Makes the api call to both parse the resume and then attach the file . File is only attached if the resume parse was successful .
151
27
14,723
protected FileApiResponse handleDeleteFile ( Class < ? extends FileEntity > type , Integer entityId , Integer fileId ) { Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesDeleteFile ( BullhornEntityInfo . getTypesRestEntityName ( type ) , entityId , fileId ) ; String url = restUrlFactory . assembleDeleteFileUrl ( ) ; StandardFileApiResponse fileApiResponse = this . performCustomRequest ( url , null , StandardFileApiResponse . class , uriVariables , HttpMethod . DELETE , null ) ; return fileApiResponse ; }
Makes the api call to delete a file attached to an entity .
139
14
14,724
protected < C extends CrudResponse , T extends AssociationEntity > C handleAssociateWithEntity ( Class < T > type , Integer entityId , AssociationField < T , ? extends BullhornEntity > associationName , Set < Integer > associationIds ) { Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesForAssociateWithEntity ( BullhornEntityInfo . getTypesRestEntityName ( type ) , entityId , associationName , associationIds ) ; String url = restUrlFactory . assembleEntityUrlForAssociateWithEntity ( ) ; CrudResponse response = null ; try { response = this . performCustomRequest ( url , null , CreateResponse . class , uriVariables , HttpMethod . PUT , null ) ; } catch ( HttpStatusCodeException error ) { response = restErrorHandler . handleHttpFourAndFiveHundredErrors ( new CreateResponse ( ) , error , entityId ) ; } return ( C ) response ; }
Makes the api call to create associations .
213
9
14,725
public < T extends BullhornEntity > CrudResponse handleHttpFourAndFiveHundredErrors ( CrudResponse response , HttpStatusCodeException error , Integer id ) { response . setChangedEntityId ( id ) ; Message message = new Message ( ) ; message . setDetailMessage ( error . getResponseBodyAsString ( ) ) ; message . setSeverity ( "ERROR" ) ; message . setType ( error . getStatusCode ( ) . toString ( ) ) ; response . addOneMessage ( message ) ; response . setErrorCode ( error . getStatusCode ( ) . toString ( ) ) ; response . setErrorMessage ( error . getResponseBodyAsString ( ) ) ; return response ; }
Updates the passed in CrudResponse with the HttpStatusCodeException thrown by the RestTemplate .
154
21
14,726
private void displayMBeans ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { Iterator mbeans ; try { mbeans = getDomainData ( ) ; } catch ( Exception e ) { throw new ServletException ( "Failed to get MBeans" , e ) ; } request . setAttribute ( "mbeans" , mbeans ) ; RequestDispatcher rd = this . getServletContext ( ) . getRequestDispatcher ( "/displaymbeans.jsp" ) ; rd . forward ( request , response ) ; }
Display all MBeans
129
5
14,727
private void inspectMBean ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { String name = request . getParameter ( "name" ) ; if ( trace ) log . trace ( "inspectMBean, name=" + name ) ; try { MBeanData data = getMBeanData ( name ) ; request . setAttribute ( "mbeanData" , data ) ; RequestDispatcher rd = this . getServletContext ( ) . getRequestDispatcher ( "/inspectmbean.jsp" ) ; rd . forward ( request , response ) ; } catch ( Exception e ) { throw new ServletException ( "Failed to get MBean data" , e ) ; } }
Display a MBeans attributes and operations
166
8
14,728
private void updateAttributes ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { String name = request . getParameter ( "name" ) ; if ( trace ) log . trace ( "updateAttributes, name=" + name ) ; Enumeration paramNames = request . getParameterNames ( ) ; HashMap < String , String > attributes = new HashMap < String , String > ( ) ; while ( paramNames . hasMoreElements ( ) ) { String param = ( String ) paramNames . nextElement ( ) ; if ( param . equals ( "name" ) || param . equals ( "action" ) ) continue ; String value = request . getParameter ( param ) ; if ( trace ) log . trace ( "name=" + param + ", value='" + value + "'" ) ; // Ignore null values, these are empty write-only fields if ( value == null || value . length ( ) == 0 ) continue ; attributes . put ( param , value ) ; } try { AttributeList newAttributes = setAttributes ( name , attributes ) ; MBeanData data = getMBeanData ( name ) ; request . setAttribute ( "mbeanData" , data ) ; RequestDispatcher rd = this . getServletContext ( ) . getRequestDispatcher ( "/inspectmbean.jsp" ) ; rd . forward ( request , response ) ; } catch ( Exception e ) { throw new ServletException ( "Failed to update attributes" , e ) ; } }
Update the writable attributes of a MBean
329
10
14,729
private void invokeOpByName ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { String name = request . getParameter ( "name" ) ; if ( trace ) log . trace ( "invokeOpByName, name=" + name ) ; String [ ] argTypes = request . getParameterValues ( "argType" ) ; String [ ] args = getArgs ( request ) ; String methodName = request . getParameter ( "methodName" ) ; if ( methodName == null ) throw new ServletException ( "No methodName given in invokeOpByName form" ) ; try { OpResultInfo opResult = invokeOpByName ( name , methodName , argTypes , args ) ; request . setAttribute ( "opResultInfo" , opResult ) ; RequestDispatcher rd = this . getServletContext ( ) . getRequestDispatcher ( "/displayopresult.jsp" ) ; rd . forward ( request , response ) ; } catch ( Exception e ) { throw new ServletException ( "Failed to invoke operation" , e ) ; } }
Invoke a MBean operation given the method name and its signature .
240
15
14,730
private MBeanData getMBeanData ( final String name ) throws PrivilegedActionException { return AccessController . doPrivileged ( new PrivilegedExceptionAction < MBeanData > ( ) { public MBeanData run ( ) throws Exception { return Server . getMBeanData ( name ) ; } } ) ; }
Get the MBean data for a bean
71
9
14,731
@ SuppressWarnings ( { "unchecked" } ) private AttributeList setAttributes ( final String name , final HashMap attributes ) throws PrivilegedActionException { return AccessController . doPrivileged ( new PrivilegedExceptionAction < AttributeList > ( ) { public AttributeList run ( ) throws Exception { return Server . setAttributes ( name , attributes ) ; } } ) ; }
Set attributes on a MBean
83
7
14,732
private void writeTransaction ( Definition def , Writer out , int indent ) throws IOException { writeWithIndent ( out , indent , "/**\n" ) ; writeWithIndent ( out , indent , " * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.\n" ) ; writeWithIndent ( out , indent , " *\n" ) ; writeWithIndent ( out , indent , " * @return LocalTransaction instance\n" ) ; writeWithIndent ( out , indent , " * @throws ResourceException generic exception if operation fails\n" ) ; writeWithIndent ( out , indent , " */\n" ) ; writeWithIndent ( out , indent , "public LocalTransaction getLocalTransaction() throws ResourceException" ) ; writeLeftCurlyBracket ( out , indent ) ; if ( def . getSupportTransaction ( ) . equals ( "NoTransaction" ) ) { writeWithIndent ( out , indent + 1 , "throw new NotSupportedException(\"getLocalTransaction() not supported\");" ) ; } else { writeLogging ( def , out , indent + 1 , "trace" , "getLocalTransaction" ) ; writeWithIndent ( out , indent + 1 , "return null;" ) ; } writeRightCurlyBracket ( out , indent ) ; writeEol ( out ) ; writeWithIndent ( out , indent , "/**\n" ) ; writeWithIndent ( out , indent , " * Returns an <code>javax.transaction.xa.XAresource</code> instance. \n" ) ; writeWithIndent ( out , indent , " *\n" ) ; writeWithIndent ( out , indent , " * @return XAResource instance\n" ) ; writeWithIndent ( out , indent , " * @throws ResourceException generic exception if operation fails\n" ) ; writeWithIndent ( out , indent , " */\n" ) ; writeWithIndent ( out , indent , "public XAResource getXAResource() throws ResourceException" ) ; writeLeftCurlyBracket ( out , indent ) ; if ( def . getSupportTransaction ( ) . equals ( "NoTransaction" ) ) { writeWithIndent ( out , indent + 1 , "throw new NotSupportedException(\"getXAResource() not supported\");" ) ; } else { writeLogging ( def , out , indent + 1 , "trace" , "getXAResource" ) ; writeWithIndent ( out , indent + 1 , "return null;" ) ; } writeRightCurlyBracket ( out , indent ) ; writeEol ( out ) ; }
Output Transaction method
588
3
14,733
private static Class < ? > [ ] getFields ( Class < ? > clz ) { List < Class < ? > > result = new ArrayList < Class < ? > > ( ) ; Class < ? > c = clz ; while ( ! c . equals ( Object . class ) ) { try { Field [ ] fields = SecurityActions . getDeclaredFields ( c ) ; if ( fields . length > 0 ) { for ( Field f : fields ) { Class < ? > defClz = f . getType ( ) ; String defClzName = defClz . getName ( ) ; if ( ! defClz . isPrimitive ( ) && ! defClz . isArray ( ) && ! defClzName . startsWith ( "java" ) && ! defClzName . startsWith ( "javax" ) && ! result . contains ( defClz ) ) { if ( trace ) log . tracef ( "Adding field: %s" , defClzName ) ; result . add ( defClz ) ; } } } } catch ( Throwable t ) { // Ignore } c = c . getSuperclass ( ) ; } return result . toArray ( new Class < ? > [ result . size ( ) ] ) ; }
Get the classes for all the fields
272
7
14,734
public void execute ( Runnable job ) { try { executor . execute ( job ) ; } catch ( RejectedExecutionException e ) { log . warnf ( e , "Job rejected: %s" , job ) ; } }
Execute a job
51
4
14,735
public int getIdleThreads ( ) { if ( executor instanceof ThreadPoolExecutor ) { final ThreadPoolExecutor tpe = ( ThreadPoolExecutor ) executor ; return tpe . getPoolSize ( ) - tpe . getActiveCount ( ) ; } return - 1 ; }
Get the number of idle threads
64
6
14,736
public boolean isLowOnThreads ( ) { if ( executor instanceof ThreadPoolExecutor ) { final ThreadPoolExecutor tpe = ( ThreadPoolExecutor ) executor ; return tpe . getActiveCount ( ) >= tpe . getMaximumPoolSize ( ) ; } return false ; }
Is the pool low on threads ?
64
7
14,737
public static Pool createPool ( String type , ConnectionManager cm , PoolConfiguration pc ) { if ( type == null || type . equals ( "" ) ) return new DefaultPool ( cm , pc ) ; type = type . toLowerCase ( Locale . US ) ; switch ( type ) { case "default" : return new DefaultPool ( cm , pc ) ; case "stable" : return new StablePool ( cm , pc ) ; default : { Class < ? extends Pool > clz = customPoolTypes . get ( type ) ; if ( clz == null ) throw new RuntimeException ( type + " can not be found" ) ; try { Constructor constructor = clz . getConstructor ( ConnectionManager . class , PoolConfiguration . class ) ; return ( Pool ) constructor . newInstance ( cm , pc ) ; } catch ( Exception e ) { throw new RuntimeException ( type + " can not be created" , e ) ; } } } }
Create a pool
200
3
14,738
static Set < PasswordCredential > getPasswordCredentials ( final Subject subject ) { if ( System . getSecurityManager ( ) == null ) return subject . getPrivateCredentials ( PasswordCredential . class ) ; return AccessController . doPrivileged ( new PrivilegedAction < Set < PasswordCredential > > ( ) { public Set < PasswordCredential > run ( ) { return subject . getPrivateCredentials ( PasswordCredential . class ) ; } } ) ; }
Get the PasswordCredential from the Subject
106
9
14,739
static StackTraceElement [ ] getStackTrace ( final Thread t ) { if ( System . getSecurityManager ( ) == null ) return t . getStackTrace ( ) ; return AccessController . doPrivileged ( new PrivilegedAction < StackTraceElement [ ] > ( ) { public StackTraceElement [ ] run ( ) { return t . getStackTrace ( ) ; } } ) ; }
Get stack trace
88
3
14,740
public static void main ( String [ ] args ) { boolean quiet = false ; String outputDir = "." ; //put report into current directory by default int arg = 0 ; String [ ] classpath = null ; if ( args . length > 0 ) { while ( args . length > arg + 1 ) { if ( args [ arg ] . startsWith ( "-" ) ) { if ( args [ arg ] . endsWith ( "quiet" ) ) { quiet = true ; } else if ( args [ arg ] . endsWith ( "output" ) ) { arg ++ ; if ( arg + 1 >= args . length ) { usage ( ) ; System . exit ( OTHER ) ; } outputDir = args [ arg ] ; } else if ( args [ arg ] . endsWith ( "classpath" ) ) { arg ++ ; classpath = args [ arg ] . split ( System . getProperty ( "path.separator" ) ) ; } } else { usage ( ) ; System . exit ( OTHER ) ; } arg ++ ; } try { int systemExitCode = Validation . validate ( new File ( args [ arg ] ) . toURI ( ) . toURL ( ) , outputDir , classpath ) ; if ( ! quiet ) { if ( systemExitCode == SUCCESS ) { System . out . println ( "Validation sucessful" ) ; } else if ( systemExitCode == FAIL ) { System . out . println ( "Validation errors" ) ; } else if ( systemExitCode == OTHER ) { System . out . println ( "Validation unknown" ) ; } } System . exit ( systemExitCode ) ; } catch ( ArrayIndexOutOfBoundsException oe ) { usage ( ) ; System . exit ( OTHER ) ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } } else { usage ( ) ; } System . exit ( SUCCESS ) ; }
Validator standalone tool
412
4
14,741
protected LocalXAResource getLocalXAResource ( ManagedConnection mc ) throws ResourceException { TransactionalConnectionManager txCM = ( TransactionalConnectionManager ) cm ; LocalXAResource xaResource = null ; String eisProductName = null ; String eisProductVersion = null ; String jndiName = cm . getConnectionManagerConfiguration ( ) . getJndiName ( ) ; try { if ( mc . getMetaData ( ) != null ) { eisProductName = mc . getMetaData ( ) . getEISProductName ( ) ; eisProductVersion = mc . getMetaData ( ) . getEISProductVersion ( ) ; } } catch ( ResourceException re ) { // Ignore } if ( eisProductName == null ) eisProductName = jndiName ; if ( eisProductVersion == null ) eisProductVersion = jndiName ; if ( cm . getConnectionManagerConfiguration ( ) . isConnectable ( ) ) { if ( mc instanceof org . ironjacamar . core . spi . transaction . ConnectableResource ) { ConnectableResource cr = ( ConnectableResource ) mc ; xaResource = txCM . getTransactionIntegration ( ) . createConnectableLocalXAResource ( cm , eisProductName , eisProductVersion , jndiName , cr , statistics ) ; } else if ( txCM . getTransactionIntegration ( ) . isConnectableResource ( mc ) ) { xaResource = txCM . getTransactionIntegration ( ) . createConnectableLocalXAResource ( cm , eisProductName , eisProductVersion , jndiName , mc , statistics ) ; } } if ( xaResource == null ) xaResource = txCM . getTransactionIntegration ( ) . createLocalXAResource ( cm , eisProductName , eisProductVersion , jndiName , statistics ) ; return xaResource ; }
Get a LocalXAResource instance
419
8
14,742
protected XAResource getXAResource ( ManagedConnection mc ) throws ResourceException { TransactionalConnectionManager txCM = ( TransactionalConnectionManager ) cm ; XAResource xaResource = null ; if ( cm . getConnectionManagerConfiguration ( ) . isWrapXAResource ( ) ) { String eisProductName = null ; String eisProductVersion = null ; String jndiName = cm . getConnectionManagerConfiguration ( ) . getJndiName ( ) ; boolean padXid = cm . getConnectionManagerConfiguration ( ) . isPadXid ( ) ; Boolean isSameRMOverride = cm . getConnectionManagerConfiguration ( ) . isIsSameRMOverride ( ) ; try { if ( mc . getMetaData ( ) != null ) { eisProductName = mc . getMetaData ( ) . getEISProductName ( ) ; eisProductVersion = mc . getMetaData ( ) . getEISProductVersion ( ) ; } } catch ( ResourceException re ) { // Ignore } if ( eisProductName == null ) eisProductName = jndiName ; if ( eisProductVersion == null ) eisProductVersion = jndiName ; if ( cm . getConnectionManagerConfiguration ( ) . isConnectable ( ) ) { if ( mc instanceof org . ironjacamar . core . spi . transaction . ConnectableResource ) { ConnectableResource cr = ( ConnectableResource ) mc ; xaResource = txCM . getTransactionIntegration ( ) . createConnectableXAResourceWrapper ( mc . getXAResource ( ) , padXid , isSameRMOverride , eisProductName , eisProductVersion , jndiName , cr , statistics ) ; } else if ( txCM . getTransactionIntegration ( ) . isConnectableResource ( mc ) ) { xaResource = txCM . getTransactionIntegration ( ) . createConnectableXAResourceWrapper ( mc . getXAResource ( ) , padXid , isSameRMOverride , eisProductName , eisProductVersion , jndiName , mc , statistics ) ; } } if ( xaResource == null ) { XAResource xar = mc . getXAResource ( ) ; if ( ! ( xar instanceof org . ironjacamar . core . spi . transaction . xa . XAResourceWrapper ) ) { boolean firstResource = txCM . getTransactionIntegration ( ) . isFirstResource ( mc ) ; xaResource = txCM . getTransactionIntegration ( ) . createXAResourceWrapper ( xar , padXid , isSameRMOverride , eisProductName , eisProductVersion , jndiName , firstResource , statistics ) ; } else { xaResource = xar ; } } } else { xaResource = mc . getXAResource ( ) ; } return xaResource ; }
Get a XAResource instance
634
7
14,743
@ Override public void prefill ( ) { if ( isShutdown ( ) ) return ; if ( poolConfiguration . isPrefill ( ) ) { ManagedConnectionPool mcp = pools . get ( getPrefillCredential ( ) ) ; if ( mcp == null ) { // Trigger the initial-pool-size prefill by creating the ManagedConnectionPool getManagedConnectionPool ( getPrefillCredential ( ) ) ; } else { // Standard prefill request mcp . prefill ( ) ; } } }
Prefill the connection pool
113
5
14,744
@ Override public Credential getPrefillCredential ( ) { if ( this . prefillCredential == null ) { if ( cm . getSubjectFactory ( ) == null || cm . getConnectionManagerConfiguration ( ) . getSecurityDomain ( ) == null ) { prefillCredential = new Credential ( null , null ) ; } else { prefillCredential = new Credential ( SecurityActions . createSubject ( cm . getSubjectFactory ( ) , cm . getConnectionManagerConfiguration ( ) . getSecurityDomain ( ) , cm . getManagedConnectionFactory ( ) ) , null ) ; } } return this . prefillCredential ; }
Get prefill credential
145
4
14,745
protected boolean isRarArchive ( URL url ) { if ( url == null ) return false ; return isRarFile ( url ) || isRarDirectory ( url ) ; }
Does the URL represent a . rar archive
39
9
14,746
protected boolean isRarFile ( URL url ) { if ( url != null && url . toExternalForm ( ) . endsWith ( ".rar" ) && ! url . toExternalForm ( ) . startsWith ( "jar" ) ) return true ; return false ; }
Does the URL represent a . rar file
57
9
14,747
@ Override public Object getAnnotation ( ) { try { if ( isOnField ( ) ) { Class < ? > clazz = cl . loadClass ( className ) ; while ( ! clazz . equals ( Object . class ) ) { try { Field field = SecurityActions . getDeclaredField ( clazz , memberName ) ; return field . getAnnotation ( annotationClass ) ; } catch ( Throwable t ) { clazz = clazz . getSuperclass ( ) ; } } } else if ( isOnMethod ( ) ) { Class < ? > clazz = cl . loadClass ( className ) ; Class < ? > [ ] params = new Class < ? > [ parameterTypes . size ( ) ] ; int i = 0 ; for ( String paramClazz : parameterTypes ) { params [ i ] = cl . loadClass ( paramClazz ) ; i ++ ; } while ( ! clazz . equals ( Object . class ) ) { try { Method method = SecurityActions . getDeclaredMethod ( clazz , memberName , params ) ; return method . getAnnotation ( annotationClass ) ; } catch ( Throwable t ) { clazz = clazz . getSuperclass ( ) ; } } } else { // onclass Class < ? > clazz = cl . loadClass ( className ) ; return clazz . getAnnotation ( annotationClass ) ; } } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } return null ; }
Get the annotation .
321
4
14,748
public DataSources parse ( XMLStreamReader reader ) throws Exception { DataSources dataSources = null ; //iterate over tags int iterate ; try { iterate = reader . nextTag ( ) ; } catch ( XMLStreamException e ) { //found a non tag..go on. Normally non-tag found at beginning are comments or DTD declaration iterate = reader . nextTag ( ) ; } switch ( iterate ) { case END_ELEMENT : { // should mean we're done, so ignore it. break ; } case START_ELEMENT : { switch ( reader . getLocalName ( ) ) { case XML . ELEMENT_DATASOURCES : { dataSources = parseDataSources ( reader ) ; break ; } default : throw new ParserException ( bundle . unexpectedElement ( reader . getLocalName ( ) ) ) ; } break ; } default : throw new IllegalStateException ( ) ; } return dataSources ; }
Parse a - ds . xml file
200
9
14,749
public void store ( DataSources metadata , XMLStreamWriter writer ) throws Exception { if ( metadata != null && writer != null ) { writer . writeStartElement ( XML . ELEMENT_DATASOURCES ) ; if ( metadata . getDataSource ( ) != null && ! metadata . getDataSource ( ) . isEmpty ( ) ) { for ( DataSource ds : metadata . getDataSource ( ) ) { storeDataSource ( ds , writer ) ; } } if ( metadata . getXaDataSource ( ) != null && ! metadata . getXaDataSource ( ) . isEmpty ( ) ) { for ( XaDataSource xads : metadata . getXaDataSource ( ) ) { storeXaDataSource ( xads , writer ) ; } } if ( metadata . getDrivers ( ) != null && ! metadata . getDrivers ( ) . isEmpty ( ) ) { writer . writeStartElement ( XML . ELEMENT_DRIVERS ) ; for ( Driver drv : metadata . getDrivers ( ) ) { storeDriver ( drv , writer ) ; } writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; } }
Store a - ds . xml file
252
8
14,750
protected void storeDriver ( Driver drv , XMLStreamWriter writer ) throws Exception { writer . writeStartElement ( XML . ELEMENT_DRIVER ) ; if ( drv . getName ( ) != null ) writer . writeAttribute ( XML . ATTRIBUTE_NAME , drv . getValue ( XML . ATTRIBUTE_NAME , drv . getName ( ) ) ) ; if ( drv . getModule ( ) != null ) writer . writeAttribute ( XML . ATTRIBUTE_MODULE , drv . getValue ( XML . ATTRIBUTE_MODULE , drv . getModule ( ) ) ) ; if ( drv . getMajorVersion ( ) != null ) writer . writeAttribute ( XML . ATTRIBUTE_MAJOR_VERSION , drv . getValue ( XML . ATTRIBUTE_MAJOR_VERSION , drv . getMajorVersion ( ) . toString ( ) ) ) ; if ( drv . getMinorVersion ( ) != null ) writer . writeAttribute ( XML . ATTRIBUTE_MINOR_VERSION , drv . getValue ( XML . ATTRIBUTE_MINOR_VERSION , drv . getMinorVersion ( ) . toString ( ) ) ) ; if ( drv . getDriverClass ( ) != null ) { writer . writeStartElement ( XML . ELEMENT_DRIVER_CLASS ) ; writer . writeCharacters ( drv . getValue ( XML . ELEMENT_DRIVER_CLASS , drv . getDriverClass ( ) ) ) ; writer . writeEndElement ( ) ; } if ( drv . getDataSourceClass ( ) != null ) { writer . writeStartElement ( XML . ELEMENT_DATASOURCE_CLASS ) ; writer . writeCharacters ( drv . getValue ( XML . ELEMENT_DATASOURCE_CLASS , drv . getDataSourceClass ( ) ) ) ; writer . writeEndElement ( ) ; } if ( drv . getXaDataSourceClass ( ) != null ) { writer . writeStartElement ( XML . ELEMENT_XA_DATASOURCE_CLASS ) ; writer . writeCharacters ( drv . getValue ( XML . ELEMENT_XA_DATASOURCE_CLASS , drv . getXaDataSourceClass ( ) ) ) ; writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; }
Store a driver
513
3
14,751
public static ClassDefinition createClassDefinition ( Serializable s , Class < ? > clz ) { if ( s == null || clz == null ) return null ; String name = clz . getName ( ) ; long serialVersionUID = 0L ; byte [ ] data = null ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; InputStream is = null ; try { try { Field svuf = getSerialVersionUID ( clz ) ; if ( svuf != null ) serialVersionUID = ( long ) svuf . get ( s ) ; } catch ( Throwable t ) { // No serialVersionUID value } String clzName = name . replace ( ' ' , ' ' ) + ".class" ; is = SecurityActions . getClassLoader ( s . getClass ( ) ) . getResourceAsStream ( clzName ) ; int i = is . read ( ) ; while ( i != - 1 ) { baos . write ( i ) ; i = is . read ( ) ; } data = baos . toByteArray ( ) ; return new ClassDefinition ( name , serialVersionUID , data ) ; } catch ( Throwable t ) { // Ignore } finally { if ( is != null ) { try { is . close ( ) ; } catch ( IOException ioe ) { // Ignore } } } return null ; }
Create a class definition
288
4
14,752
private static Field getSerialVersionUID ( Class < ? > clz ) { Class < ? > c = clz ; while ( c != null ) { try { Field svuf = SecurityActions . getDeclaredField ( clz , "serialVersionUID" ) ; SecurityActions . setAccessible ( svuf ) ; return svuf ; } catch ( Throwable t ) { // No serialVersionUID definition } c = c . getSuperclass ( ) ; } return null ; }
Find the serialVersionUID field
103
6
14,753
protected WorkManager parseWorkManager ( XMLStreamReader reader ) throws XMLStreamException , ParserException , ValidateException { WorkManagerSecurity security = null ; while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case END_ELEMENT : { if ( CommonXML . ELEMENT_WORKMANAGER . equals ( reader . getLocalName ( ) ) ) { return new WorkManagerImpl ( security ) ; } else { switch ( reader . getLocalName ( ) ) { case CommonXML . ELEMENT_SECURITY : break ; default : throw new ParserException ( bundle . unexpectedEndTag ( reader . getLocalName ( ) ) ) ; } } break ; } case START_ELEMENT : { switch ( reader . getLocalName ( ) ) { case CommonXML . ELEMENT_SECURITY : { security = parseWorkManagerSecurity ( reader ) ; break ; } default : throw new ParserException ( bundle . unexpectedElement ( reader . getLocalName ( ) ) ) ; } break ; } } } throw new ParserException ( bundle . unexpectedEndOfDocument ( ) ) ; }
Parse workmanager element
243
5
14,754
protected void storeAdminObject ( AdminObject ao , XMLStreamWriter writer ) throws Exception { writer . writeStartElement ( CommonXML . ELEMENT_ADMIN_OBJECT ) ; if ( ao . getClassName ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_CLASS_NAME , ao . getValue ( CommonXML . ATTRIBUTE_CLASS_NAME , ao . getClassName ( ) ) ) ; if ( ao . getJndiName ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_JNDI_NAME , ao . getValue ( CommonXML . ATTRIBUTE_JNDI_NAME , ao . getJndiName ( ) ) ) ; if ( ao . isEnabled ( ) != null && ( ao . hasExpression ( CommonXML . ATTRIBUTE_ENABLED ) || ! Defaults . ENABLED . equals ( ao . isEnabled ( ) ) ) ) writer . writeAttribute ( CommonXML . ATTRIBUTE_ENABLED , ao . getValue ( CommonXML . ATTRIBUTE_ENABLED , ao . isEnabled ( ) . toString ( ) ) ) ; if ( ao . getId ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_ID , ao . getValue ( CommonXML . ATTRIBUTE_ID , ao . getId ( ) ) ) ; if ( ao . getConfigProperties ( ) != null && ! ao . getConfigProperties ( ) . isEmpty ( ) ) { Iterator < Map . Entry < String , String > > it = ao . getConfigProperties ( ) . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry < String , String > entry = it . next ( ) ; writer . writeStartElement ( CommonXML . ELEMENT_CONFIG_PROPERTY ) ; writer . writeAttribute ( CommonXML . ATTRIBUTE_NAME , entry . getKey ( ) ) ; writer . writeCharacters ( ao . getValue ( CommonXML . ELEMENT_CONFIG_PROPERTY , entry . getKey ( ) , entry . getValue ( ) ) ) ; writer . writeEndElement ( ) ; } } writer . writeEndElement ( ) ; }
Store admin object
523
3
14,755
public static AnnotationScanner getAnnotationScanner ( ) { if ( active != null ) return active ; if ( defaultImplementation == null ) throw new IllegalStateException ( bundle . noAnnotationScanner ( ) ) ; return defaultImplementation ; }
Get the annotation scanner
54
4
14,756
void writeConfigPropsDeclare ( Definition def , Writer out , int indent ) throws IOException { if ( getConfigProps ( def ) == null ) return ; for ( int i = 0 ; i < getConfigProps ( def ) . size ( ) ; i ++ ) { writeWithIndent ( out , indent , "/** " + getConfigProps ( def ) . get ( i ) . getName ( ) + " */\n" ) ; if ( def . isUseAnnotation ( ) ) { writeIndent ( out , indent ) ; out . write ( "@ConfigProperty(defaultValue = \"" + getConfigProps ( def ) . get ( i ) . getValue ( ) + "\")" ) ; if ( getConfigProps ( def ) . get ( i ) . isRequired ( ) ) { out . write ( " @NotNull" ) ; } writeEol ( out ) ; } writeWithIndent ( out , indent , "private " + getConfigProps ( def ) . get ( i ) . getType ( ) + " " + getConfigProps ( def ) . get ( i ) . getName ( ) + ";\n\n" ) ; } }
Output Configuration Properties Declare
260
5
14,757
void writeConfigProps ( Definition def , Writer out , int indent ) throws IOException { if ( getConfigProps ( def ) == null ) return ; for ( int i = 0 ; i < getConfigProps ( def ) . size ( ) ; i ++ ) { String name = getConfigProps ( def ) . get ( i ) . getName ( ) ; String upcaseName = upcaseFirst ( name ) ; //set writeWithIndent ( out , indent , "/** \n" ) ; writeWithIndent ( out , indent , " * Set " + name ) ; writeEol ( out ) ; writeWithIndent ( out , indent , " * @param " + name + " The value\n" ) ; writeWithIndent ( out , indent , " */\n" ) ; writeWithIndent ( out , indent , "public void set" + upcaseName + "(" + getConfigProps ( def ) . get ( i ) . getType ( ) + " " + name + ")" ) ; writeLeftCurlyBracket ( out , indent ) ; writeWithIndent ( out , indent + 1 , "this." + name + " = " + name + ";" ) ; writeRightCurlyBracket ( out , indent ) ; writeEol ( out ) ; //get writeWithIndent ( out , indent , "/** \n" ) ; writeWithIndent ( out , indent , " * Get " + name ) ; writeEol ( out ) ; writeWithIndent ( out , indent , " * @return The value\n" ) ; writeWithIndent ( out , indent , " */\n" ) ; writeWithIndent ( out , indent , "public " + getConfigProps ( def ) . get ( i ) . getType ( ) + " get" + upcaseName + "()" ) ; writeLeftCurlyBracket ( out , indent ) ; writeWithIndent ( out , indent + 1 , "return " + name + ";" ) ; writeRightCurlyBracket ( out , indent ) ; writeEol ( out ) ; } }
Output Configuration Properties
457
3
14,758
public synchronized Object verifyConnectionListener ( ConnectionListener cl ) throws ResourceException { for ( Map . Entry < Object , Map < ManagedConnectionPool , ConnectionListener > > entry : transactionMap . entrySet ( ) ) { if ( entry . getValue ( ) . values ( ) . contains ( cl ) ) { try { TransactionalConnectionManager txCM = ( TransactionalConnectionManager ) cm ; Transaction tx = txCM . getTransactionIntegration ( ) . getTransactionManager ( ) . getTransaction ( ) ; Object id = txCM . getTransactionIntegration ( ) . getTransactionSynchronizationRegistry ( ) . getTransactionKey ( ) ; if ( ! id . equals ( entry . getKey ( ) ) ) return entry . getKey ( ) ; } catch ( Exception e ) { throw new ResourceException ( e ) ; } } } return null ; }
Verify if a connection listener is already in use
181
10
14,759
public static List < Failure > validateConfigPropertiesType ( ValidateClass vo , String section , String failMsg ) { List < Failure > failures = new ArrayList < Failure > ( 1 ) ; for ( ConfigProperty cpmd : vo . getConfigProperties ( ) ) { try { containGetOrIsMethod ( vo , "get" , cpmd , section , failMsg , failures ) ; } catch ( Throwable t ) { try { containGetOrIsMethod ( vo , "is" , cpmd , section , failMsg , failures ) ; } catch ( Throwable it ) { // Ignore } } } if ( failures . isEmpty ( ) ) return null ; return failures ; }
validate ConfigProperties type
148
6
14,760
private static void containGetOrIsMethod ( ValidateClass vo , String getOrIs , ConfigProperty cpmd , String section , String failMsg , List < Failure > failures ) throws NoSuchMethodException { String methodName = getOrIs + cpmd . getConfigPropertyName ( ) . getValue ( ) . substring ( 0 , 1 ) . toUpperCase ( Locale . US ) ; if ( cpmd . getConfigPropertyName ( ) . getValue ( ) . length ( ) > 1 ) { methodName += cpmd . getConfigPropertyName ( ) . getValue ( ) . substring ( 1 ) ; } Method method = SecurityActions . getMethod ( vo . getClazz ( ) , methodName , ( Class [ ] ) null ) ; if ( ! VALID_TYPES . contains ( method . getReturnType ( ) ) ) { StringBuilder sb = new StringBuilder ( "Class: " + vo . getClazz ( ) . getName ( ) ) ; sb = sb . append ( " Property: " + cpmd . getConfigPropertyName ( ) . getValue ( ) ) ; sb = sb . append ( " Type: " + method . getReturnType ( ) . getName ( ) ) ; Failure failure ; if ( WARNING_TYPES . contains ( method . getReturnType ( ) ) ) { failure = new Failure ( Severity . WARNING , section , failMsg , sb . toString ( ) ) ; } else { failure = new Failure ( Severity . ERROR , section , failMsg , sb . toString ( ) ) ; } failures . add ( failure ) ; } }
validated object contain get or is Method
358
8
14,761
protected org . ironjacamar . core . connectionmanager . listener . ConnectionListener getConnectionListener ( Credential credential ) throws ResourceException { org . ironjacamar . core . connectionmanager . listener . ConnectionListener result = null ; Exception failure = null ; // First attempt boolean isInterrupted = Thread . interrupted ( ) ; boolean innerIsInterrupted = false ; try { result = pool . getConnectionListener ( credential ) ; if ( supportsLazyAssociation == null ) { supportsLazyAssociation = ( result . getManagedConnection ( ) instanceof DissociatableManagedConnection ) ? Boolean . TRUE : Boolean . FALSE ; } return result ; } catch ( ResourceException e ) { failure = e ; // Retry? if ( cmConfiguration . getAllocationRetry ( ) != 0 || e instanceof RetryableException ) { int to = cmConfiguration . getAllocationRetry ( ) ; long sleep = cmConfiguration . getAllocationRetryWaitMillis ( ) ; if ( to == 0 && e instanceof RetryableException ) to = 1 ; for ( int i = 0 ; i < to ; i ++ ) { if ( shutdown . get ( ) ) { throw new ResourceException ( ) ; } if ( Thread . currentThread ( ) . isInterrupted ( ) ) { Thread . interrupted ( ) ; innerIsInterrupted = true ; } try { if ( sleep > 0 ) Thread . sleep ( sleep ) ; return pool . getConnectionListener ( credential ) ; } catch ( ResourceException re ) { failure = re ; } catch ( InterruptedException ie ) { failure = ie ; innerIsInterrupted = true ; } } } } catch ( Exception e ) { failure = e ; } finally { if ( isInterrupted || innerIsInterrupted ) { Thread . currentThread ( ) . interrupt ( ) ; if ( innerIsInterrupted ) throw new ResourceException ( failure ) ; } } if ( cmConfiguration . isSharable ( ) && Boolean . TRUE . equals ( supportsLazyAssociation ) ) return associateConnectionListener ( credential , null ) ; // If we get here all retries failed, throw the lastest failure throw new ResourceException ( failure ) ; }
Get a connection listener
459
4
14,762
private org . ironjacamar . core . connectionmanager . listener . ConnectionListener associateConnectionListener ( Credential credential , Object connection ) throws ResourceException { log . tracef ( "associateConnectionListener(%s, %s)" , credential , connection ) ; if ( isShutdown ( ) ) { throw new ResourceException ( ) ; } if ( ! cmConfiguration . isSharable ( ) ) throw new ResourceException ( ) ; org . ironjacamar . core . connectionmanager . listener . ConnectionListener cl = pool . getActiveConnectionListener ( credential ) ; if ( cl == null ) { if ( ! pool . isFull ( ) ) { try { cl = pool . getConnectionListener ( credential ) ; } catch ( ResourceException re ) { // Ignore } } if ( cl == null ) { org . ironjacamar . core . connectionmanager . listener . ConnectionListener removeCl = pool . removeConnectionListener ( null ) ; if ( removeCl != null ) { try { if ( ccm != null ) { for ( Object c : removeCl . getConnections ( ) ) { ccm . unregisterConnection ( this , removeCl , c ) ; } } returnConnectionListener ( removeCl , true ) ; cl = pool . getConnectionListener ( credential ) ; } catch ( ResourceException ire ) { // Nothing we can do } } else { if ( getTransactionSupport ( ) == TransactionSupportLevel . NoTransaction ) { org . ironjacamar . core . connectionmanager . listener . ConnectionListener targetCl = pool . removeConnectionListener ( credential ) ; if ( targetCl != null ) { if ( targetCl . getManagedConnection ( ) instanceof DissociatableManagedConnection ) { DissociatableManagedConnection dmc = ( DissociatableManagedConnection ) targetCl . getManagedConnection ( ) ; if ( ccm != null ) { for ( Object c : targetCl . getConnections ( ) ) { ccm . unregisterConnection ( this , targetCl , c ) ; } } dmc . dissociateConnections ( ) ; targetCl . clearConnections ( ) ; cl = targetCl ; } else { try { if ( ccm != null ) { for ( Object c : targetCl . getConnections ( ) ) { ccm . unregisterConnection ( this , targetCl , c ) ; } } returnConnectionListener ( targetCl , true ) ; cl = pool . getConnectionListener ( credential ) ; } catch ( ResourceException ire ) { // Nothing we can do } } } } } } } if ( cl == null ) throw new ResourceException ( ) ; if ( connection != null ) { // Associate managed connection with the connection cl . getManagedConnection ( ) . associateConnection ( connection ) ; cl . addConnection ( connection ) ; if ( ccm != null ) { ccm . registerConnection ( this , cl , connection ) ; } } return cl ; }
Associate a ConnectionListener
609
5
14,763
private boolean shouldEnlist ( ConnectionListener cl ) { if ( cmConfiguration . isEnlistment ( ) && cl . getManagedConnection ( ) instanceof LazyEnlistableManagedConnection ) return false ; return true ; }
Should enlist the ConnectionListener
49
5
14,764
static WARClassLoader createWARClassLoader ( final Kernel kernel , final ClassLoader parent ) { return AccessController . doPrivileged ( new PrivilegedAction < WARClassLoader > ( ) { public WARClassLoader run ( ) { return new WARClassLoader ( kernel , parent ) ; } } ) ; }
Create a WARClassLoader
63
5
14,765
static WebAppClassLoader createWebAppClassLoader ( final ClassLoader cl , final WebAppContext wac ) { return AccessController . doPrivileged ( new PrivilegedAction < WebAppClassLoader > ( ) { public WebAppClassLoader run ( ) { try { return new WebAppClassLoader ( cl , wac ) ; } catch ( IOException ioe ) { return null ; } } } ) ; }
Create a WebClassLoader
87
5
14,766
void generateRaCode ( Definition def ) { if ( def . isUseRa ( ) ) { generateClassCode ( def , "Ra" ) ; generateClassCode ( def , "RaMeta" ) ; } if ( def . isGenAdminObject ( ) ) { for ( int i = 0 ; i < def . getAdminObjects ( ) . size ( ) ; i ++ ) { generateMultiAdminObjectClassCode ( def , "AoImpl" , i ) ; generateMultiAdminObjectClassCode ( def , "AoInterface" , i ) ; } } }
generate resource adapter code
121
5
14,767
void generateOutboundCode ( Definition def ) { if ( def . isSupportOutbound ( ) ) { if ( def . getMcfDefs ( ) == null ) throw new IllegalStateException ( "Should define at least one mcf class" ) ; for ( int num = 0 ; num < def . getMcfDefs ( ) . size ( ) ; num ++ ) { generateMultiMcfClassCode ( def , "Mcf" , num ) ; generateMultiMcfClassCode ( def , "Mc" , num ) ; generateMultiMcfClassCode ( def , "McMeta" , num ) ; if ( ! def . getMcfDefs ( ) . get ( num ) . isUseCciConnection ( ) ) { generateMultiMcfClassCode ( def , "CfInterface" , num ) ; generateMultiMcfClassCode ( def , "Cf" , num ) ; generateMultiMcfClassCode ( def , "ConnInterface" , num ) ; generateMultiMcfClassCode ( def , "ConnImpl" , num ) ; } else { generateMultiMcfClassCode ( def , "CciConn" , num ) ; generateMultiMcfClassCode ( def , "CciConnFactory" , num ) ; generateMultiMcfClassCode ( def , "ConnMeta" , num ) ; generateMultiMcfClassCode ( def , "ConnSpec" , num ) ; } } } }
generate outbound code
305
5
14,768
void generateInboundCode ( Definition def ) { if ( def . isSupportInbound ( ) ) { if ( def . isDefaultPackageInbound ( ) ) generateClassCode ( def , "Ml" , "inflow" ) ; generateClassCode ( def , "As" , "inflow" ) ; generateClassCode ( def , "Activation" , "inflow" ) ; generatePackageInfo ( def , "main" , "inflow" ) ; } }
generate inbound code
102
5
14,769
void generateMBeanCode ( Definition def ) { if ( def . isSupportOutbound ( ) ) { generateClassCode ( def , "MbeanInterface" , "mbean" ) ; generateClassCode ( def , "MbeanImpl" , "mbean" ) ; generatePackageInfo ( def , "main" , "mbean" ) ; } }
generate MBean code
77
6
14,770
void generateClassCode ( Definition def , String className , String subDir ) { if ( className == null || className . equals ( "" ) ) return ; try { String clazzName = this . getClass ( ) . getPackage ( ) . getName ( ) + ".code." + className + "CodeGen" ; String javaFile = Definition . class . getMethod ( "get" + className + "Class" ) . invoke ( def , ( Object [ ] ) null ) + ".java" ; FileWriter fw ; if ( subDir == null ) fw = Utils . createSrcFile ( javaFile , def . getRaPackage ( ) , def . getOutputDir ( ) ) ; else fw = Utils . createSrcFile ( javaFile , def . getRaPackage ( ) + "." + subDir , def . getOutputDir ( ) ) ; Class < ? > clazz = Class . forName ( clazzName , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; AbstractCodeGen codeGen = ( AbstractCodeGen ) clazz . newInstance ( ) ; codeGen . generate ( def , fw ) ; fw . flush ( ) ; fw . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
generate class code
285
4
14,771
void generateMultiMcfClassCode ( Definition def , String className , int num ) { if ( className == null || className . equals ( "" ) ) return ; if ( num < 0 || num + 1 > def . getMcfDefs ( ) . size ( ) ) return ; try { String clazzName = this . getClass ( ) . getPackage ( ) . getName ( ) + ".code." + className + "CodeGen" ; String javaFile = McfDef . class . getMethod ( "get" + className + "Class" ) . invoke ( def . getMcfDefs ( ) . get ( num ) , ( Object [ ] ) null ) + ".java" ; FileWriter fw ; fw = Utils . createSrcFile ( javaFile , def . getRaPackage ( ) , def . getOutputDir ( ) ) ; Class < ? > clazz = Class . forName ( clazzName , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; AbstractCodeGen codeGen = ( AbstractCodeGen ) clazz . newInstance ( ) ; codeGen . setNumOfMcf ( num ) ; codeGen . generate ( def , fw ) ; fw . flush ( ) ; fw . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
generate multi mcf class code
295
7
14,772
void generateMultiAdminObjectClassCode ( Definition def , String className , int num ) { if ( className == null || className . equals ( "" ) ) return ; try { String clazzName = this . getClass ( ) . getPackage ( ) . getName ( ) + ".code." + className + "CodeGen" ; Class < ? > clazz = Class . forName ( clazzName , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; AbstractCodeGen codeGen = ( AbstractCodeGen ) clazz . newInstance ( ) ; String javaFile = "" ; if ( codeGen instanceof AoImplCodeGen ) { ( ( AoImplCodeGen ) codeGen ) . setNumOfAo ( num ) ; javaFile = def . getAdminObjects ( ) . get ( num ) . getAdminObjectClass ( ) + ".java" ; } else if ( codeGen instanceof AoInterfaceCodeGen ) { ( ( AoInterfaceCodeGen ) codeGen ) . setNumOfAo ( num ) ; javaFile = def . getAdminObjects ( ) . get ( num ) . getAdminObjectInterface ( ) + ".java" ; } FileWriter fw = Utils . createSrcFile ( javaFile , def . getRaPackage ( ) , def . getOutputDir ( ) ) ; codeGen . generate ( def , fw ) ; fw . flush ( ) ; fw . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
generate multi admin object class code
329
7
14,773
void generateAntIvyXml ( Definition def , String outputDir ) { try { FileWriter antfw = Utils . createFile ( "build.xml" , outputDir ) ; BuildIvyXmlGen bxGen = new BuildIvyXmlGen ( ) ; bxGen . generate ( def , antfw ) ; antfw . close ( ) ; FileWriter ivyfw = Utils . createFile ( "ivy.xml" , outputDir ) ; IvyXmlGen ixGen = new IvyXmlGen ( ) ; ixGen . generate ( def , ivyfw ) ; ivyfw . close ( ) ; FileWriter ivySettingsfw = Utils . createFile ( "ivy.settings.xml" , outputDir ) ; IvySettingsXmlGen isxGen = new IvySettingsXmlGen ( ) ; isxGen . generate ( def , ivySettingsfw ) ; ivySettingsfw . close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } }
generate ant + ivy build . xml and ivy files
226
13
14,774
void generateGradle ( Definition def , String outputDir ) { try { FileWriter bgfw = Utils . createFile ( "build.gradle" , outputDir ) ; BuildGradleGen bgGen = new BuildGradleGen ( ) ; bgGen . generate ( def , bgfw ) ; bgfw . close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } }
generate gradle build . gradle
96
8
14,775
void generateRaXml ( Definition def , String outputDir ) { if ( ! def . isUseAnnotation ( ) ) { try { outputDir = outputDir + File . separatorChar + "src" + File . separatorChar + "main" + File . separatorChar + "resources" ; FileWriter rafw = Utils . createFile ( "ra.xml" , outputDir + File . separatorChar + "META-INF" ) ; RaXmlGen raGen = getRaXmlGen ( def ) ; raGen . generate ( def , rafw ) ; rafw . close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } } }
generate ra . xml
159
5
14,776
void generateIronjacamarXml ( Definition def , String outputDir ) { try { String resourceDir = outputDir + File . separatorChar + "src" + File . separatorChar + "main" + File . separatorChar + "resources" ; writeIronjacamarXml ( def , resourceDir ) ; if ( def . getBuild ( ) . equals ( "maven" ) ) { String rarDir = outputDir + File . separatorChar + "src" + File . separatorChar + "main" + File . separatorChar + "rar" ; writeIronjacamarXml ( def , rarDir ) ; } } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } }
generate ant ironjacamar . xml
160
8
14,777
void generateMbeanXml ( Definition def , String outputDir ) { String mbeanName = def . getDefaultValue ( ) . toLowerCase ( Locale . US ) ; if ( def . getRaPackage ( ) != null && ! def . getRaPackage ( ) . equals ( "" ) ) { if ( def . getRaPackage ( ) . indexOf ( ' ' ) >= 0 ) { mbeanName = def . getRaPackage ( ) . substring ( def . getRaPackage ( ) . lastIndexOf ( ' ' ) + 1 ) ; } else mbeanName = def . getRaPackage ( ) ; } try { outputDir = outputDir + File . separatorChar + "src" + File . separatorChar + "main" + File . separatorChar + "resources" + File . separatorChar + "jca" ; FileWriter mbfw = Utils . createFile ( mbeanName + ".xml" , outputDir ) ; MbeanXmlGen mbGen = new MbeanXmlGen ( ) ; mbGen . generate ( def , mbfw ) ; mbfw . close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } }
generate mbean deployment xml
267
6
14,778
void generatePackageInfo ( Definition def , String outputDir , String subDir ) { try { FileWriter fw ; PackageInfoGen phGen ; if ( outputDir . equals ( "test" ) ) { fw = Utils . createTestFile ( "package-info.java" , def . getRaPackage ( ) , def . getOutputDir ( ) ) ; phGen = new PackageInfoGen ( ) ; } else { if ( subDir == null ) { fw = Utils . createSrcFile ( "package-info.java" , def . getRaPackage ( ) , def . getOutputDir ( ) ) ; phGen = new PackageInfoGen ( ) ; } else { fw = Utils . createSrcFile ( "package-info.java" , def . getRaPackage ( ) + "." + subDir , def . getOutputDir ( ) ) ; phGen = new PackageInfoGen ( subDir ) ; } } phGen . generate ( def , fw ) ; fw . close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } }
generate package . html
243
5
14,779
void generateEisCode ( Definition def ) { try { String clazzName = this . getClass ( ) . getPackage ( ) . getName ( ) + ".code.TestEisCodeGen" ; String javaFile = def . getDefaultValue ( ) + "Handler.java" ; FileWriter fw = Utils . createTestFile ( javaFile , def . getRaPackage ( ) , def . getOutputDir ( ) ) ; Class < ? > clazz = Class . forName ( clazzName , true , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; AbstractCodeGen codeGen = ( AbstractCodeGen ) clazz . newInstance ( ) ; codeGen . generate ( def , fw ) ; fw . flush ( ) ; fw . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
generate Eis test server
189
6
14,780
static void setThreadContextClassLoader ( final ClassLoader cl ) { AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { public Object run ( ) { Thread . currentThread ( ) . setContextClassLoader ( cl ) ; return null ; } } ) ; }
Set the thread context class loader
60
6
14,781
static void closeURLClassLoader ( final URLClassLoader cl ) { AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { public Object run ( ) { if ( cl != null ) { try { cl . close ( ) ; } catch ( IOException ioe ) { // Ignore } } return null ; } } ) ; }
Close an URLClassLoader
73
5
14,782
private static void outputRaDesc ( RaImpl raImpl , PrintStream out ) throws ParserConfigurationException , SAXException , IOException , TransformerFactoryConfigurationError , TransformerConfigurationException , TransformerException { String raString = "<resource-adapters>" + raImpl . toString ( ) + "</resource-adapters>" ; DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; Document doc = db . parse ( new InputSource ( new StringReader ( raString ) ) ) ; out . println ( ) ; out . println ( "Deployment descriptor:" ) ; out . println ( "----------------------" ) ; TransformerFactory tfactory = TransformerFactory . newInstance ( ) ; Transformer serializer ; serializer = tfactory . newTransformer ( ) ; //Setup indenting to "pretty print" serializer . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; serializer . setOutputProperty ( "{http://xml.apache.org/xslt}indent-amount" , "2" ) ; serializer . transform ( new DOMSource ( doc ) , new StreamResult ( out ) ) ; }
Output Resource Adapter XML description
257
5
14,783
private static boolean scanArchive ( Connector cmd ) { if ( cmd == null ) return true ; if ( cmd . getVersion ( ) == Version . V_16 || cmd . getVersion ( ) == Version . V_17 ) { if ( ! cmd . isMetadataComplete ( ) ) return true ; } return false ; }
Should the archive be scanned for annotations
70
7
14,784
private static Map < String , String > getIntrospectedProperties ( String clz , URLClassLoader cl , PrintStream error ) { Map < String , String > result = null ; try { Class < ? > c = Class . forName ( clz , true , cl ) ; result = new TreeMap < String , String > ( ) ; Method [ ] methods = c . getMethods ( ) ; for ( Method m : methods ) { if ( m . getName ( ) . startsWith ( "set" ) && m . getParameterTypes ( ) . length == 1 && isValidType ( m . getParameterTypes ( ) [ 0 ] ) ) { String name = m . getName ( ) . substring ( 3 ) ; if ( name . length ( ) == 1 ) { name = name . toLowerCase ( Locale . US ) ; } else { name = name . substring ( 0 , 1 ) . toLowerCase ( Locale . US ) + name . substring ( 1 ) ; } String type = m . getParameterTypes ( ) [ 0 ] . getName ( ) ; result . put ( name , type ) ; } } } catch ( Throwable t ) { // Nothing we can do t . printStackTrace ( error ) ; } return result ; }
Get the introspected properties for a class
273
9
14,785
private static void removeIntrospectedValue ( Map < String , String > m , String name ) { if ( m != null ) { m . remove ( name ) ; if ( name . length ( ) == 1 ) { name = name . toUpperCase ( Locale . US ) ; } else { name = name . substring ( 0 , 1 ) . toUpperCase ( Locale . US ) + name . substring ( 1 ) ; } m . remove ( name ) ; if ( name . length ( ) == 1 ) { name = name . toLowerCase ( Locale . US ) ; } else { name = name . substring ( 0 , 1 ) . toLowerCase ( Locale . US ) + name . substring ( 1 ) ; } m . remove ( name ) ; } }
Remove introspected value
172
5
14,786
private static String getValueString ( XsdString value ) { if ( value == null || value == XsdString . NULL_XSDSTRING ) return "" ; else return value . getValue ( ) ; }
get correct value string
45
4
14,787
public static synchronized void getConnectionListener ( String poolName , Object mcp , Object cl , boolean pooled , boolean interleaving , Throwable callstack ) { if ( ! interleaving ) { if ( pooled ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . GET_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . GET_CONNECTION_LISTENER_NEW , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } } else { if ( pooled ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . GET_INTERLEAVING_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . GET_INTERLEAVING_CONNECTION_LISTENER_NEW , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } } }
Get connection listener
410
3
14,788
public static synchronized void returnConnectionListener ( String poolName , Object mcp , Object cl , boolean kill , boolean interleaving , Throwable callstack ) { if ( ! interleaving ) { if ( ! kill ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . RETURN_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . RETURN_CONNECTION_LISTENER_WITH_KILL , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } } else { if ( ! kill ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . RETURN_INTERLEAVING_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . RETURN_INTERLEAVING_CONNECTION_LISTENER_WITH_KILL , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } } }
Return connection listener
424
3
14,789
public static synchronized void clearConnectionListener ( String poolName , Object mcp , Object cl ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . CLEAR_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) ) ) ; }
Clear connection listener
88
3
14,790
public static synchronized void enlistConnectionListener ( String poolName , Object mcp , Object cl , String tx , boolean success , boolean interleaving ) { if ( ! interleaving ) { if ( success ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . ENLIST_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . ENLIST_CONNECTION_LISTENER_FAILED , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } } else { if ( success ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . ENLIST_INTERLEAVING_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . ENLIST_INTERLEAVING_CONNECTION_LISTENER_FAILED , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } } }
Enlist connection listener
392
4
14,791
public static synchronized void delistConnectionListener ( String poolName , Object mcp , Object cl , String tx , boolean success , boolean rollbacked , boolean interleaving ) { if ( ! rollbacked ) { if ( ! interleaving ) { if ( success ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DELIST_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DELIST_CONNECTION_LISTENER_FAILED , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } } else { if ( success ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DELIST_INTERLEAVING_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DELIST_INTERLEAVING_CONNECTION_LISTENER_FAILED , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } } } else { if ( success ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DELIST_ROLLEDBACK_CONNECTION_LISTENER , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } else { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DELIST_ROLLEDBACK_CONNECTION_LISTENER_FAILED , Integer . toHexString ( System . identityHashCode ( cl ) ) , tx . replace ( ' ' , ' ' ) ) ) ; } } }
Delist connection listener
587
4
14,792
public static synchronized void createConnectionListener ( String poolName , Object mcp , Object cl , Object mc , boolean get , boolean prefill , boolean incrementer , Throwable callstack ) { if ( get ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . CREATE_CONNECTION_LISTENER_GET , Integer . toHexString ( System . identityHashCode ( cl ) ) , Integer . toHexString ( System . identityHashCode ( mc ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( prefill ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . CREATE_CONNECTION_LISTENER_PREFILL , Integer . toHexString ( System . identityHashCode ( cl ) ) , Integer . toHexString ( System . identityHashCode ( mc ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( incrementer ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . CREATE_CONNECTION_LISTENER_INCREMENTER , Integer . toHexString ( System . identityHashCode ( cl ) ) , Integer . toHexString ( System . identityHashCode ( mc ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } }
Create connection listener
376
3
14,793
public static synchronized void destroyConnectionListener ( String poolName , Object mcp , Object cl , boolean ret , boolean idle , boolean invalid , boolean flush , boolean error , boolean prefill , boolean incrementer , Throwable callstack ) { if ( ret ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DESTROY_CONNECTION_LISTENER_RETURN , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( idle ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DESTROY_CONNECTION_LISTENER_IDLE , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( invalid ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DESTROY_CONNECTION_LISTENER_INVALID , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( flush ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DESTROY_CONNECTION_LISTENER_FLUSH , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( error ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DESTROY_CONNECTION_LISTENER_ERROR , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( prefill ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DESTROY_CONNECTION_LISTENER_PREFILL , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } else if ( incrementer ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . DESTROY_CONNECTION_LISTENER_INCREMENTER , Integer . toHexString ( System . identityHashCode ( cl ) ) , ! confidential && callstack != null ? toString ( callstack ) : "" ) ) ; } }
Destroy connection listener
718
3
14,794
public static synchronized void createManagedConnectionPool ( String poolName , Object mcp ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . MANAGED_CONNECTION_POOL_CREATE , "NONE" ) ) ; }
Create managed connection pool
78
4
14,795
public static synchronized void destroyManagedConnectionPool ( String poolName , Object mcp ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . MANAGED_CONNECTION_POOL_DESTROY , "NONE" ) ) ; }
Destroy managed connection pool
79
4
14,796
public static synchronized void pushCCMContext ( String key , Throwable callstack ) { log . tracef ( "%s" , new TraceEvent ( "CachedConnectionManager" , "NONE" , TraceEvent . PUSH_CCM_CONTEXT , "NONE" , key , callstack != null ? toString ( callstack ) : "" ) ) ; }
Push CCM context
79
4
14,797
public static synchronized void popCCMContext ( String key , Throwable callstack ) { log . tracef ( "%s" , new TraceEvent ( "CachedConnectionManager" , "NONE" , TraceEvent . POP_CCM_CONTEXT , "NONE" , key , callstack != null ? toString ( callstack ) : "" ) ) ; }
Pop CCM context
78
4
14,798
public static synchronized void registerCCMConnection ( String poolName , Object mcp , Object cl , Object connection , String key ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . REGISTER_CCM_CONNECTION , Integer . toHexString ( System . identityHashCode ( cl ) ) , Integer . toHexString ( System . identityHashCode ( connection ) ) , key ) ) ; }
Register CCM connection
113
4
14,799
public static synchronized void unregisterCCMConnection ( String poolName , Object mcp , Object cl , Object connection , String key ) { log . tracef ( "%s" , new TraceEvent ( poolName , Integer . toHexString ( System . identityHashCode ( mcp ) ) , TraceEvent . UNREGISTER_CCM_CONNECTION , Integer . toHexString ( System . identityHashCode ( cl ) ) , Integer . toHexString ( System . identityHashCode ( connection ) ) , key ) ) ; }
Unregister CCM connection
115
5