idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
37,200
private Facelet _getFacelet ( FacesContext context , String viewId ) throws IOException { FaceletFactory . setInstance ( _faceletFactory ) ; try { return _faceletFactory . getFacelet ( context , viewId ) ; } finally { FaceletFactory . setInstance ( null ) ; } }
Gets the Facelet representing the specified view identifier .
37,201
protected void retrieveBundleContext ( ) { BundleContext bc = TxBundleTools . getBundleContext ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "retrieveBundleContext from TxBundleTools, bc " + bc ) ; if ( bc == null ) { bc = EmbeddableTxBundleTools . getBundleContext ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "retrieveBundleContext from EmbeddableTxBundleTools, bc " + bc ) ; } _bc = bc ; }
This method retrieves bundle context from the the ws . tx . embeddable bundle so that if that bundle has started before the tx . jta bundle then we are still able to access the Service Registry .
37,202
public synchronized void setRequestBufferSize ( int size ) { if ( size <= 0 ) { throw new IllegalArgumentException ( "request buffer size must be greater than zero" ) ; } if ( this . requestBuffer . size ( ) != 0 ) { throw new IllegalStateException ( "cannot resize non-empty ThreadPool request buffer" ) ; } this . requestBuffer = new BoundedBuffer ( size ) ; requestBufferInitialCapacity_ = size ; requestBufferExpansionLimit_ = requestBufferInitialCapacity_ * 10 ; }
Sets the size of the request buffer . If work has been dispatched on this thread pool the behavior of this method and all subsequent calls to this pool are undefined .
37,203
protected void addThread ( Runnable command ) { Worker worker ; if ( _isDecoratedZOS ) worker = new DecoratedZOSWorker ( command , threadid ++ ) ; else worker = new Worker ( command , threadid ++ ) ; if ( contextClassLoader != null && THREAD_CONTEXT_ACCESSOR . getContextClassLoader ( worker ) != contextClassLoader ) { THREAD_CONTEXT_ACCESSOR . setContextClassLoader ( worker , contextClassLoader ) ; } Thread . interrupted ( ) ; threads_ . put ( worker , worker ) ; ++ poolSize_ ; ++ activeThreads ; if ( command == null ) { requestBuffer . incrementWaitingThreads ( ) ; } fireThreadCreated ( poolSize_ ) ; try { worker . start ( ) ; } catch ( OutOfMemoryError error ) { threads_ . remove ( worker ) ; -- poolSize_ ; -- activeThreads ; fireThreadDestroyed ( poolSize_ ) ; throw error ; } }
Create and start a thread to handle a new command . Call only when holding lock .
37,204
public int createThreads ( int numberOfThreads ) { int ncreated = 0 ; for ( int i = 0 ; i < numberOfThreads ; ++ i ) { synchronized ( this ) { if ( poolSize_ < maximumPoolSize_ ) { addThread ( null ) ; ++ ncreated ; } else break ; } } return ncreated ; }
Create and start up to numberOfThreads threads in the pool . Return the number created . This may be less than the number requested if creating more would exceed maximum pool size bound .
37,205
protected synchronized void workerDone ( Worker w , boolean taskDied ) { threads_ . remove ( w ) ; if ( taskDied ) { -- activeThreads ; -- poolSize_ ; } if ( poolSize_ == 0 && shutdown_ ) { maximumPoolSize_ = minimumPoolSize_ = 0 ; notifyAll ( ) ; } fireThreadDestroyed ( poolSize_ ) ; }
Cleanup method called upon termination of worker thread .
37,206
protected Runnable getTask ( boolean oldThread ) throws InterruptedException { long waitTime ; Runnable r = null ; boolean firstTime = true ; while ( true ) { synchronized ( this ) { if ( firstTime ) { -- activeThreads ; if ( oldThread ) { requestBuffer . incrementWaitingThreads ( ) ; } } if ( poolSize_ > maximumPoolSize_ ) { if ( ! growasneeded || ! firstTime ) { -- poolSize_ ; requestBuffer . decrementWaitingThreads ( ) ; return null ; } } waitTime = ( shutdown_ ) ? 0 : ( poolSize_ <= minimumPoolSize_ ) ? - 1 : keepAliveTime_ ; } try { r = ( waitTime >= 0 ) ? ( Runnable ) ( requestBuffer . poll ( waitTime ) ) : ( Runnable ) ( requestBuffer . take ( ) ) ; } catch ( InterruptedException e ) { ++ activeThreads ; synchronized ( this ) { requestBuffer . decrementWaitingThreads ( ) ; } ; throw e ; } synchronized ( this ) { if ( r == null ) { r = ( Runnable ) requestBuffer . poll ( 0 ) ; } if ( r != null ) { ++ activeThreads ; break ; } else if ( poolSize_ > minimumPoolSize_ ) { poolSize_ -- ; requestBuffer . decrementWaitingThreads ( ) ; break ; } } firstTime = false ; } return r ; }
Get a task from the handoff queue or null if shutting down .
37,207
public void setDecoratedZOS ( ) { if ( xMemSetupThread == null ) { try { final Class xMemCRBridgeClass = Class . forName ( "com.ibm.ws390.xmem.XMemCRBridgeImpl" ) ; xMemSetupThread = xMemCRBridgeClass . getMethod ( "setupThreadStub" , new Class [ ] { java . lang . Object . class } ) ; } catch ( Throwable t ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Unexpected exception caught accessing XMemCRBridgeImpl.setupThreadStub" , t ) ; } } if ( xMemSetupThread != null ) { _isDecoratedZOS = true ; } }
sets this thread pool to create threads which are decorated via setupThreadStub
37,208
public void executeOnDaemon ( Runnable command ) { int id = 0 ; final Runnable commandToRun = command ; synchronized ( this ) { this . daemonId ++ ; id = this . daemonId ; } final String runId = name + " : DMN" + id ; Thread t = ( Thread ) AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { Thread temp = new Thread ( commandToRun , runId ) ; temp . setDaemon ( true ) ; return temp ; } } ) ; t . start ( ) ; }
Dispatch work on a daemon thread . This thread is not accounted for in the pool . There are no corresponding ThreadPoolListener events . There is no MonitorPlugin support .
37,209
public void execute ( Runnable command , int blockingMode ) throws InterruptedException , ThreadPoolQueueIsFullException , IllegalStateException { execute ( command , blockingMode , 0 ) ; }
Arrange for the given command to be executed by a thread in this pool . The call s behavior when the pool and its internal request queue are at full capacity is determined by the blockingMode .
37,210
public Runnable execute ( Runnable command , long timeoutInMillis ) throws InterruptedException , IllegalStateException { try { return execute ( command , WAIT_WHEN_QUEUE_IS_FULL , timeoutInMillis ) ; } catch ( ThreadPoolQueueIsFullException e ) { return null ; } }
Arrange for the given command to be executed by a thread in this pool . If the pools internal request buffer is full the call will block for at most timeoutInMillis milliseconds .
37,211
public void setMonitorPlugin ( MonitorPlugin plugin ) throws TooManyListenersException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setMonitorPlugin" , plugin ) ; } if ( this . monitorPlugin != null && ! this . monitorPlugin . equals ( plugin ) ) { throw new TooManyListenersException ( "INTERNAL ERROR: ThreadPool.MonitorPlugin already set." ) ; } this . monitorPlugin = plugin ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "setMonitorPlugin" , plugin ) ; } }
Registers a MonitorPlugin with this thread pool . Only one plugin is supported in the current implementation .
37,212
public void checkAllThreads ( ) { if ( this . monitorPlugin == null ) { return ; } long currentTime = 0 ; try { for ( Iterator i = this . threads_ . values ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Worker thread = ( Worker ) i . next ( ) ; synchronized ( thread ) { if ( thread . getStartTime ( ) > 0 ) { if ( currentTime == 0 ) { currentTime = System . currentTimeMillis ( ) ; } if ( ! thread . isHung && this . monitorPlugin . checkThread ( thread , thread . threadNumber , currentTime - thread . getStartTime ( ) ) ) { thread . isHung = true ; } } } } this . lastThreadCheckDidntComplete = false ; } catch ( ConcurrentModificationException e ) { if ( this . lastThreadCheckDidntComplete ) { } this . lastThreadCheckDidntComplete = true ; } }
Checks all active threads in this thread pool to determine if they are hung . The definition of hung is provided by the MonitorPlugin .
37,213
public FilterCellSlowStr findNextCell ( String nextValue ) { if ( nextCell == null ) { return null ; } return nextCell . get ( nextValue ) ; }
Find the next cell for a given string which may come after this cell in the address tree .
37,214
protected boolean invokeGeneratePluginCfgMBean ( ParseLoginAddress loginAddress , String clusterName , String targetPath , String option ) { boolean success = false ; try { success = connection . generatePluginConfig ( loginAddress , clusterName , targetPath , option ) ; if ( success ) success = copyFileToTargetPath ( loginAddress , clusterName , targetPath ) ; if ( success ) { if ( option . equalsIgnoreCase ( "server" ) ) { commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.complete.server" ) ) ; } else commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.complete.collective" ) ) ; } else if ( option . equalsIgnoreCase ( "server" ) ) { commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.fail.server" ) ) ; } else commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.fail.collective" ) ) ; } catch ( RuntimeMBeanException e ) { commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } catch ( UnknownHostException e ) { commandConsole . printlnErrorMessage ( getMessage ( "common.hostError" , loginAddress . getHost ( ) ) ) ; } catch ( ConnectException e ) { commandConsole . printlnErrorMessage ( getMessage ( "common.portError" , loginAddress . getPort ( ) ) ) ; } catch ( IOException e ) { commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } catch ( Exception e ) { String msg = e . getMessage ( ) ; if ( msg != null ) { commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.notEnabled" ) ) ; } commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } finally { try { connection . closeConnector ( ) ; } catch ( IOException e ) { commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } } return success ; }
Invokes MBean for generatePluginConfig to generate plugin configuration file
37,215
public static TraceFactory getTraceFactory ( NLS nls ) { return ( TraceFactory ) Utils . getImpl ( "com.ibm.ws.objectManager.utils.TraceFactoryImpl" , new Class [ ] { NLS . class } , new Object [ ] { nls } ) ; }
Create a platform specific TraceFactory instance .
37,216
public void setActiveTrace ( String activeNames , int traceLevel ) throws java . io . IOException { TraceFactory . activeNames = activeNames ; TraceFactory . traceLevel = traceLevel ; ; }
Specify what to trace and start tracing it .
37,217
protected void setSICoreConnection ( SICoreConnection connection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSICoreConnection" , connection ) ; validateConversationState ( ) ; cConState . setSICoreConnection ( connection ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setSICoreConnection" ) ; }
Sets the SICoreConnection reference on the server
37,218
public Serializable copy ( Serializable obj ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy : " + Util . identity ( obj ) ) ; if ( obj == null ) { return obj ; } Class < ? > objType = obj . getClass ( ) ; if ( ( objType == String . class ) || ( objType == Integer . class ) || ( objType == Long . class ) || ( objType == Boolean . class ) || ( objType == Byte . class ) || ( objType == Character . class ) || ( objType == Float . class ) || ( objType == Double . class ) || ( objType == Short . class ) ) { return obj ; } Class < ? > componentType = objType . getComponentType ( ) ; if ( componentType != null && componentType . isPrimitive ( ) ) { if ( componentType == boolean . class ) return ( ( boolean [ ] ) obj ) . clone ( ) ; if ( componentType == byte . class ) return ( ( byte [ ] ) obj ) . clone ( ) ; if ( componentType == char . class ) return ( ( char [ ] ) obj ) . clone ( ) ; if ( componentType == short . class ) return ( ( short [ ] ) obj ) . clone ( ) ; if ( componentType == int . class ) return ( ( int [ ] ) obj ) . clone ( ) ; if ( componentType == long . class ) return ( ( long [ ] ) obj ) . clone ( ) ; if ( componentType == float . class ) return ( ( float [ ] ) obj ) . clone ( ) ; if ( componentType == double . class ) return ( ( double [ ] ) obj ) . clone ( ) ; } if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy : making a deep copy" ) ; return copySerializable ( obj ) ; }
Make a copy of an object by writing it out to stream and reading it back again . This will make a deep copy of the object .
37,219
public ScheduleExpression copy ( ScheduleExpression schedule ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy ScheduleExpression: " + Util . identity ( schedule ) ) ; if ( schedule . getClass ( ) == ScheduleExpression . class ) { return copyBase ( schedule ) ; } return ( ScheduleExpression ) copySerializable ( schedule ) ; }
Make a copy of a ScheduleExpression object .
37,220
public static ScheduleExpression copyBase ( ScheduleExpression schedule ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy copyBase: " + Util . identity ( schedule ) ) ; return new ScheduleExpression ( ) . start ( schedule . getStart ( ) == null ? null : new Date ( schedule . getStart ( ) . getTime ( ) ) ) . end ( schedule . getEnd ( ) == null ? null : new Date ( schedule . getEnd ( ) . getTime ( ) ) ) . timezone ( schedule . getTimezone ( ) ) . second ( schedule . getSecond ( ) ) . minute ( schedule . getMinute ( ) ) . hour ( schedule . getHour ( ) ) . dayOfMonth ( schedule . getDayOfMonth ( ) ) . dayOfWeek ( schedule . getDayOfWeek ( ) ) . month ( schedule . getMonth ( ) ) . year ( schedule . getYear ( ) ) ; }
Make a copy of a javax . ejb . ScheduleExpression portion of the object .
37,221
BigInteger setMultiChoiceCount ( ) { if ( fields != null ) for ( int i = 0 ; i < fields . length ; i ++ ) multiChoiceCount = multiChoiceCount . multiply ( fields [ i ] . setMultiChoiceCount ( ) ) ; return multiChoiceCount ; }
Set the multiChoiceCount for this tuple
37,222
public JSVariant [ ] getDominatedVariants ( ) { if ( dominated == null ) { List dom = new ArrayList ( ) ; getDominatedVariants ( dom ) ; dominated = ( JSVariant [ ] ) dom . toArray ( new JSVariant [ 0 ] ) ; } return dominated ; }
Identify any variants that are descendents of this tuple either directly or via other tuples . Used in MessageMap construction .
37,223
public static ChainStartMode getKey ( int ordinal ) { if ( ordinal >= 0 && ordinal < _values . length ) { return _values [ ordinal ] ; } return null ; }
Get the chain start mode definition for this ordinal .
37,224
public static InjectionTarget getInjectionTarget ( ComponentNameSpaceConfiguration compNSConfig , ClientInjection injection ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getInjectionTarget: " + injection ) ; ClientInjectionBinding binding = new ClientInjectionBinding ( compNSConfig , injection ) ; Class < ? > injectionType = binding . loadClass ( injection . getInjectionTypeName ( ) ) ; String targetName = injection . getTargetName ( ) ; String targetClassName = injection . getTargetClassName ( ) ; binding . addInjectionTarget ( injectionType , targetName , targetClassName ) ; InjectionTarget target = InjectionProcessorContextImpl . getInjectionTargets ( binding ) . get ( 0 ) ; binding . metadataProcessingComplete ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getInjectionTarget: " + target ) ; return target ; }
Acquires an InjectionTarget for the specified ClientInjection .
37,225
protected ArrayList filterXidsByType ( Xid [ ] xidArray ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "filterXidsByType" , xidArray ) ; final ArrayList < XidImpl > xidList = new ArrayList < XidImpl > ( ) ; if ( xidArray != null ) { for ( int y = 0 ; y < xidArray . length ; y ++ ) { if ( xidArray [ y ] == null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "RM has returned null inDoubt Xid entry - " + y ) ; continue ; } if ( XidImpl . isOurFormatId ( xidArray [ y ] . getFormatId ( ) ) ) { XidImpl ourXid = null ; if ( xidArray [ y ] instanceof XidImpl ) { ourXid = ( XidImpl ) xidArray [ y ] ; } else { ourXid = new XidImpl ( xidArray [ y ] ) ; if ( ourXid . getBranchQualifier ( ) . length != XidImpl . BQUAL_JTA_BQUAL_LENGTH ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Xid is wrong length - " + y ) ; continue ; } } xidList . add ( ourXid ) ; } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "filterXidsByType" , xidList ) ; return xidList ; }
Removes all non - WAS Xids from an array of Xids and puts them in an ArrayList structure .
37,226
protected ArrayList filterXidsByCruuidAndEpoch ( ArrayList xidList , byte [ ] cruuid , int epoch ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "filterXidsByCruuidAndEpoch" , new Object [ ] { xidList , cruuid , epoch } ) ; for ( int x = xidList . size ( ) - 1 ; x >= 0 ; x -- ) { final XidImpl ourXid = ( XidImpl ) xidList . get ( x ) ; final byte [ ] xidCruuid = ourXid . getCruuid ( ) ; final int xidEpoch = ourXid . getEpoch ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Trace other Cruuid: " + xidCruuid + ", or: " + Util . toHexString ( xidCruuid ) ) ; Tr . debug ( tc , "Trace my Cruuid: " + cruuid + ", or: " + Util . toHexString ( cruuid ) ) ; } if ( ( ! java . util . Arrays . equals ( cruuid , xidCruuid ) ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "filterXidsByCruuidAndEpoch: cruuid is different: " + ourXid . getCruuid ( ) ) ; xidList . remove ( x ) ; } else if ( xidEpoch >= epoch ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "filterXidsByCruuidAndEpoch: xid epoch is " + xidEpoch ) ; xidList . remove ( x ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "filterXidsByCruuidAndEpoch" , xidList ) ; return xidList ; }
Removes all Xids from an ArrayList that don t have our cruuid in their bqual . Assumes that all Xids are XidImpls .
37,227
protected boolean canWeForgetXid ( XidImpl ourXid , Xid [ ] knownXids ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "canWeForgetXid" , new Object [ ] { ourXid , knownXids } ) ; if ( tc . isDebugEnabled ( ) ) { for ( int i = 0 ; i < knownXids . length ; i ++ ) { Tr . debug ( tc , "tx xid[" + i + "] " + knownXids [ i ] ) ; } } boolean forgetMe = true ; final int jtaFormatId = ourXid . getFormatId ( ) ; final byte [ ] jtaGtrid = ourXid . getGlobalTransactionId ( ) ; final byte [ ] fullJtaBqual = ourXid . getBranchQualifier ( ) ; byte [ ] jtaBqual = null ; int txnFormatId ; byte [ ] txnGtrid ; byte [ ] txnBqual ; int x = 0 ; while ( ( x < knownXids . length ) && ( forgetMe == true ) ) { if ( x == 0 ) { final int bqualLength = ( knownXids [ x ] . getBranchQualifier ( ) ) . length ; jtaBqual = new byte [ bqualLength ] ; System . arraycopy ( fullJtaBqual , 0 , jtaBqual , 0 , bqualLength ) ; } txnFormatId = knownXids [ x ] . getFormatId ( ) ; txnGtrid = knownXids [ x ] . getGlobalTransactionId ( ) ; txnBqual = knownXids [ x ] . getBranchQualifier ( ) ; if ( ( jtaFormatId == txnFormatId ) && ( java . util . Arrays . equals ( jtaGtrid , txnGtrid ) ) && ( java . util . Arrays . equals ( jtaBqual , txnBqual ) ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Xid has been matched to a transaction:" , ourXid ) ; } auditTransactionXid ( ourXid , knownXids [ x ] , getXAResourceInfo ( ) ) ; forgetMe = false ; } x ++ ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "canWeForgetXid" , forgetMe ) ; return forgetMe ; }
Iterates over the list of known Xids retrieved from transaction service and tries to match the given javax . transaction . xa . Xid with one of them .
37,228
private static void propogateSecureSession ( HttpServletRequest request , Message message ) { final String cipherSuite = ( String ) request . getAttribute ( SSL_CIPHER_SUITE_ATTRIBUTE ) ; if ( cipherSuite != null ) { final java . security . cert . Certificate [ ] certs = ( java . security . cert . Certificate [ ] ) request . getAttribute ( SSL_PEER_CERT_CHAIN_ATTRIBUTE ) ; message . put ( TLSSessionInfo . class , new TLSSessionInfo ( cipherSuite , null , certs ) ) ; } }
Propogate in the message a TLSSessionInfo instance representative of the TLS - specific information in the HTTP request .
37,229
private void cacheInput ( Message outMessage ) { if ( outMessage . getExchange ( ) == null ) { return ; } Message inMessage = outMessage . getExchange ( ) . getInMessage ( ) ; if ( inMessage == null ) { return ; } Object o = inMessage . get ( "cxf.io.cacheinput" ) ; DelegatingInputStream in = inMessage . getContent ( DelegatingInputStream . class ) ; if ( PropertyUtils . isTrue ( o ) ) { Collection < Attachment > atts = inMessage . getAttachments ( ) ; if ( atts != null ) { for ( Attachment a : atts ) { if ( a . getDataHandler ( ) . getDataSource ( ) instanceof AttachmentDataSource ) { try { ( ( AttachmentDataSource ) a . getDataHandler ( ) . getDataSource ( ) ) . cache ( inMessage ) ; } catch ( IOException e ) { throw new Fault ( e ) ; } } } } if ( in != null ) { in . cacheInput ( ) ; } } else if ( in != null ) { try { IOUtils . consume ( in , 16 * 1024 * 1024 ) ; } catch ( Exception ioe ) { } } }
On first write we need to make sure any attachments and such that are still on the incoming stream are read in . Otherwise we can get into a deadlock where the client is still trying to send the request but the server is trying to send the response . Neither side is reading and both blocked on full buffers . Not a good situation .
37,230
public static void processException ( Object source , Class sourceClass , String methodName , Throwable throwable , String probe , Object [ ] objects ) { if ( TraceComponent . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( cclass , "processException" , new Object [ ] { source , sourceClass , methodName , throwable , probe , objects } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && trace . isEventEnabled ( ) ) trace . event ( cclass , "processException" , throwable ) ; print ( source , sourceClass , methodName , throwable , probe , objects ) ; com . ibm . ws . ffdc . FFDCFilter . processException ( throwable , sourceClass . getName ( ) + ":" + methodName , probe , source , objects ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( cclass , "processException" ) ; }
Process an exception for a non static class .
37,231
static void print ( Object object , java . io . PrintWriter printWriter ) { if ( object instanceof Printable ) { ( ( Printable ) object ) . print ( printWriter ) ; } else { printWriter . print ( object ) ; } }
Dump an Object to a java . io . PrintWriter .
37,232
byte [ ] getServiceData ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getServiceData" , this ) ; if ( _activeFile == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getServiceData" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } final byte [ ] serviceData = _activeFile . getServiceData ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getServiceData" , RLSUtils . toHexString ( serviceData , RLSUtils . MAX_DISPLAY_BYTES ) ) ; return serviceData ; }
Package access method to return the current service data .
37,233
LogFileHeader logFileHeader ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logFileHeader" , this ) ; if ( _activeFile == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileHeader" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } final LogFileHeader logFileHeader = _activeFile . logFileHeader ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileHeader" , logFileHeader ) ; return logFileHeader ; }
Returns the LogFileHeader for the currently active log file .
37,234
ArrayList < ReadableLogRecord > recoveredRecords ( ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "recoveredRecords" , _recoveredRecords ) ; return _recoveredRecords ; }
Returns an array of ReadableLogRecords retrieved when the recovery log was opened .
37,235
void setServiceData ( byte [ ] serviceData ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setServiceData" , new java . lang . Object [ ] { RLSUtils . toHexString ( serviceData , RLSUtils . MAX_DISPLAY_BYTES ) , this } ) ; if ( ( _file1 == null ) || ( _file2 == null ) ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setServiceData" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } _serviceData = serviceData ; _file1 . setServiceData ( serviceData ) ; _file2 . setServiceData ( serviceData ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setServiceData" ) ; }
Package access method to replace the existing service data with the new service data .
37,236
protected void writeLogRecord ( LogRecord logRecord ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeLogRecord" , logRecord ) ; _activeFile . writeLogRecord ( logRecord ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeLogRecord" ) ; }
Do any necessary under the covers work to write the LogRecord .
37,237
public static Map < String , String > processArchiveManifest ( final JarFile jarFile ) throws Throwable { Map < String , String > manifestAttrs = null ; if ( jarFile != null ) { try { manifestAttrs = AccessController . doPrivileged ( new PrivilegedExceptionAction < Map < String , String > > ( ) { public Map < String , String > run ( ) throws ZipException , IOException { InputStream is = null ; Map < String , String > attrs = null ; try { is = jarFile . getInputStream ( jarFile . getEntry ( JarFile . MANIFEST_NAME ) ) ; attrs = ManifestProcessor . readManifestIntoMap ( ManifestProcessor . parseManifest ( is ) ) ; } finally { if ( is != null ) { InstallUtils . close ( is ) ; } } return attrs ; } } ) ; } catch ( PrivilegedActionException e ) { throw e . getCause ( ) ; } } return manifestAttrs ; }
Gets the archive file Manifest attributes as a String Map from a jar file .
37,238
public static Map < String , String > processArchiveManifest ( final File file ) throws Throwable { Map < String , String > manifestAttrs = null ; if ( file != null && file . isFile ( ) && ArchiveFileType . JAR . isType ( file . getPath ( ) ) ) { JarFile jarFile = null ; try { jarFile = new JarFile ( file ) ; manifestAttrs = processArchiveManifest ( jarFile ) ; } finally { if ( jarFile != null ) { InstallUtils . close ( jarFile ) ; } } } return manifestAttrs ; }
Gets the archive file Manifest attributes as a String Map from a file .
37,239
public static String getLicenseAgreement ( final JarFile jar , final Map < String , String > manifestAttrs ) { String licenseAgreement = null ; if ( manifestAttrs . isEmpty ( ) ) { return licenseAgreement ; } String licenseAgreementPrefix = manifestAttrs . get ( ArchiveUtils . LICENSE_AGREEMENT ) ; LicenseProvider licenseProvider = ( licenseAgreementPrefix != null ) ? ZipLicenseProvider . createInstance ( jar , licenseAgreementPrefix ) : null ; if ( licenseProvider != null ) licenseAgreement = new InstallLicenseImpl ( "" , LicenseType . UNSPECIFIED , licenseProvider ) . getAgreement ( ) ; return licenseAgreement ; }
Gets the license agreement for the jar file .
37,240
public void deactivate ( ComponentContext context ) { if ( contextRef . get ( ) == null ) { throw new IllegalStateException ( "not activated" ) ; } this . contextRef . set ( null ) ; }
Deactivates the map . Will trigger a release of all held services .
37,241
public void init ( HttpInboundServiceContext sc ) { setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; }
Initialize this incoming HTTP request message .
37,242
public void init ( HttpOutboundServiceContext sc ) { setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; setVersion ( getServiceContext ( ) . getHttpConfig ( ) . getOutgoingVersion ( ) ) ; }
Initialize this outgoing HTTP request message .
37,243
public void init ( HttpInboundServiceContext sc , BNFHeaders hdrs ) { setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; if ( null != hdrs ) { hdrs . duplicate ( this ) ; } }
Initialize this incoming HTTP request message with specific headers ie . ones stored in a cache perhaps .
37,244
public void init ( HttpOutboundServiceContext sc , BNFHeaders hdrs ) { setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; if ( null != hdrs ) { hdrs . duplicate ( this ) ; } setVersion ( getServiceContext ( ) . getHttpConfig ( ) . getOutgoingVersion ( ) ) ; }
Initialize this outgoing HTTP request message with specific headers ie . ones stored in a cache perhaps .
37,245
public WsByteBuffer [ ] encodePseudoHeaders ( ) { WsByteBuffer [ ] firstLine = new WsByteBuffer [ 1 ] ; firstLine [ 0 ] = allocateBuffer ( getOutgoingBufferSize ( ) ) ; LiteralIndexType indexType = LiteralIndexType . NOINDEXING ; H2HeaderTable table = this . getH2HeaderTable ( ) ; byte [ ] encodedHeader = null ; try { encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . METHOD , this . myMethod . toString ( ) , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . SCHEME , this . myScheme . toString ( ) , indexType ) ; this . myScheme . toString ( ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; if ( this . sUrlHost != null ) { encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . AUTHORITY , this . sUrlHost , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; } encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . PATH , this . myURIString , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . error ( tc , e . getMessage ( ) ) ; } return null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { String url = GenericUtils . nullOutPasswords ( getMarshalledSecondToken ( ) , ( byte ) '&' ) ; Tr . event ( tc , "Encoding first line: " + getMethod ( ) + " " + url + " " + getVersion ( ) ) ; } return firstLine ; }
of the first line .
37,246
public void setMethod ( String method ) throws UnsupportedMethodException { MethodValues val = MethodValues . match ( method , 0 , method . length ( ) ) ; if ( null == val ) { throw new UnsupportedMethodException ( "Illegal method " + method ) ; } setMethod ( val ) ; }
Set the method of this request to the given String if it is valid .
37,247
public void setMethod ( MethodValues method ) { this . myMethod = method ; super . setFirstLineChanged ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "setMethod(v): " + ( null != method ? method . getName ( ) : null ) ) ; } }
Set the request method to the given value .
37,248
final public String getRequestURI ( ) { if ( null == this . myURIString ) { this . myURIString = GenericUtils . getEnglishString ( this . myURIBytes ) ; } return this . myURIString ; }
Query the value of the request URI .
37,249
private String getTargetHost ( ) { String host = getVirtualHost ( ) ; if ( null == host ) { host = ( isIncoming ( ) ) ? getServiceContext ( ) . getLocalAddr ( ) . getCanonicalHostName ( ) : getServiceContext ( ) . getRemoteAddr ( ) . getCanonicalHostName ( ) ; } return host ; }
Find the target host of the request . This checks the VirtualHost data but falls back on the socket layer target if need be .
37,250
private int getTargetPort ( ) { int port = getVirtualPort ( ) ; if ( NOTSET == port ) { port = ( isIncoming ( ) ) ? getServiceContext ( ) . getLocalPort ( ) : getServiceContext ( ) . getRemotePort ( ) ; } return port ; }
Find the target port of the request . This checks the VirtualPort data and falls back on the socket port information if need be .
37,251
public int getVirtualPort ( ) { if ( HeaderStorage . NOTSET != this . iUrlPort ) { return this . iUrlPort ; } if ( NOT_PRESENT <= this . iHdrPort ) { return this . iHdrPort ; } byte [ ] host = getHeader ( HttpHeaderKeys . HDR_HOST ) . asBytes ( ) ; if ( null == host || host . length == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: No/empty host header" ) ; } return - 1 ; } this . iHdrPort = NOT_PRESENT ; int start = - 1 ; if ( LEFT_BRACKET == host [ 0 ] ) { start = GenericUtils . byteIndexOf ( host , RIGHT_BRACKET , 0 ) ; if ( - 1 == start ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: Invalid IPV6 ip in host header" ) ; } return - 1 ; } start ++ ; } else { start = GenericUtils . byteIndexOf ( host , BNFHeaders . COLON , 0 ) ; } if ( - 1 == start || host . length <= start || BNFHeaders . COLON != host [ start ] ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: No port in host header" ) ; } return - 1 ; } start ++ ; int length = host . length - start ; if ( 0 >= length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: No port after colon" ) ; } return - 1 ; } try { this . iHdrPort = GenericUtils . asIntValue ( host , start , length ) ; } catch ( NumberFormatException nfe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: Invalid port value: " + HttpChannelUtils . getEnglishString ( host , start , length ) ) ; } return - 1 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: returning " + this . iHdrPort ) ; } return this . iHdrPort ; }
Query the target port of this request . It will first check for a port in the URL string and if not found it will check the Host header . This will return - 1 if it is not found in either spot .
37,252
private void parseURI ( byte [ ] data , int start ) { if ( start >= data . length ) { this . myURIBytes = SLASH ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Defaulting to slash since no URI data found" ) ; } return ; } int uri_end = data . length ; for ( int i = start ; i < data . length ; i ++ ) { if ( '?' == data [ i ] ) { uri_end = i ; break ; } } if ( start == uri_end ) { throw new IllegalArgumentException ( "Missing URI: " + GenericUtils . getEnglishString ( data ) ) ; } if ( 0 == start && uri_end == data . length ) { this . myURIBytes = data ; } else { this . myURIBytes = new byte [ uri_end - start ] ; System . arraycopy ( data , start , this . myURIBytes , 0 , this . myURIBytes . length ) ; uri_end ++ ; if ( uri_end < data . length ) { byte [ ] query = new byte [ data . length - uri_end ] ; System . arraycopy ( data , uri_end , query , 0 , query . length ) ; setQueryString ( query ) ; } } }
Parse the URI information out of the input data along with any query information found afterwards . If format errors are found then an exception is thrown .
37,253
private void parseScheme ( byte [ ] data ) { for ( int i = 1 ; i < data . length ; i ++ ) { if ( ':' == data [ i ] ) { SchemeValues val = SchemeValues . match ( data , 0 , i ) ; if ( null == val ) { throw new IllegalArgumentException ( "Invalid scheme inside URL: " + GenericUtils . getEnglishString ( data ) ) ; } setScheme ( val ) ; if ( ( i + 2 ) >= data . length || ( '/' != data [ i + 1 ] || '/' != data [ i + 2 ] ) ) { throw new IllegalArgumentException ( "Invalid net_path: " + GenericUtils . getEnglishString ( data ) ) ; } parseAuthority ( data , i + 3 ) ; return ; } } throw new IllegalArgumentException ( "Invalid scheme in URL: " + GenericUtils . getEnglishString ( data ) ) ; }
Parse the scheme marker out of the input data and then start the parse for the next section . If any errors are encountered then an exception is thrown .
37,254
public void setRequestURI ( byte [ ] uri ) { if ( null == uri || 0 == uri . length ) { throw new IllegalArgumentException ( "setRequestURI: null input" ) ; } super . setFirstLineChanged ( ) ; if ( '*' == uri [ 0 ] ) { if ( 1 != uri . length && '?' != uri [ 1 ] ) { String value = GenericUtils . getEnglishString ( uri ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setRequestURI: invalid uri [" + value + "]" ) ; } throw new IllegalArgumentException ( "Invalid uri: " + value ) ; } } else if ( '/' != uri [ 0 ] ) { String value = GenericUtils . getEnglishString ( uri ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setRequestURI: invalid uri [" + value + "]" ) ; } throw new IllegalArgumentException ( "Invalid uri: " + value ) ; } initScheme ( ) ; this . myURIString = null ; this . sUrlHost = null ; this . iUrlPort = HeaderStorage . NOTSET ; this . myQueryBytes = null ; this . queryParams = null ; parseURI ( uri , 0 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setRequestURI: set URI to " + getRequestURI ( ) ) ; } }
Allow the user to set the URI in the HttpRequest to the given byte array prior to sending the request .
37,255
public void initScheme ( ) { if ( null == getServiceContext ( ) || null == getServiceContext ( ) . getTSC ( ) ) { return ; } if ( getServiceContext ( ) . isSecure ( ) ) { this . myScheme = SchemeValues . HTTPS ; } else { this . myScheme = SchemeValues . HTTP ; } }
Initialize the scheme information based on the socket being secure or not .
37,256
public String getScheme ( ) { if ( null == this . myScheme ) { initScheme ( ) ; } if ( null == this . myScheme ) { return null ; } return this . myScheme . getName ( ) ; }
Query the value of the scheme .
37,257
public void setScheme ( SchemeValues scheme ) { this . myScheme = scheme ; super . setFirstLineChanged ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setScheme(v): " + ( null != scheme ? scheme . getName ( ) : null ) ) ; } }
Set the value of the scheme in the Request by using the int identifiers .
37,258
private void deserializeMethod ( ObjectInput stream ) throws IOException , ClassNotFoundException { MethodValues method = null ; if ( SERIALIZATION_V2 == getDeserializationVersion ( ) ) { method = MethodValues . find ( readByteArray ( stream ) ) ; } else { method = MethodValues . find ( ( String ) stream . readObject ( ) ) ; } if ( null == method ) { throw new IOException ( "Missing method" ) ; } setMethod ( method ) ; }
Deserialize the method information from the input stream .
37,259
private void deserializeScheme ( ObjectInput stream ) throws IOException , ClassNotFoundException { SchemeValues scheme = null ; if ( SERIALIZATION_V2 == getDeserializationVersion ( ) ) { byte [ ] value = readByteArray ( stream ) ; if ( null == value ) { throw new IOException ( "Missing scheme" ) ; } scheme = SchemeValues . find ( value ) ; } else { String value = ( String ) stream . readObject ( ) ; scheme = SchemeValues . find ( value ) ; } setScheme ( scheme ) ; }
Deserialize the scheme information from the input stream .
37,260
private synchronized void parseParameters ( ) { if ( null != this . queryParams ) { return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "parseParameters for " + this ) ; } String encoding = getCharset ( ) . name ( ) ; String queryString = getQueryString ( ) ; if ( null != queryString ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parsing URL query data" ) ; } this . queryParams = HttpChannelUtils . parseQueryString ( queryString , encoding ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No query data found in URL" ) ; } this . queryParams = new Hashtable < String , String [ ] > ( ) ; } }
Parse the query parameters out of this message . This will check just the URL query data of the request .
37,261
protected void setDataSourceFactory ( ServiceReference < ResourceFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setDataSourceFactory" , "setting " + ref ) ; } dataSourceFactoryRef . setReference ( ref ) ; }
Declarative Services method for setting the data source service reference
37,262
protected void unsetDataSourceFactory ( ServiceReference < ResourceFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetDataSourceFactory" , "unsetting " + ref ) ; } dataSourceFactoryRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the data source service reference
37,263
protected void setResourceConfigFactory ( ServiceReference < ResourceConfigFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setResourceConfigFactory" , "setting " + ref ) ; } resourceConfigFactoryRef . setReference ( ref ) ; }
Declarative Services method for setting the ResourceConfigFactory service reference
37,264
protected void unsetResourceConfigFactory ( ServiceReference < ResourceConfigFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetResourceConfigFactory" , "unsetting " + ref ) ; } resourceConfigFactoryRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the ResourceConfigFactory service reference
37,265
protected void setLocalTransactionCurrent ( ServiceReference < LocalTransactionCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setLocalTransactionCurrent" , "setting " + ref ) ; } localTransactionCurrentRef . setReference ( ref ) ; }
Declarative Services method for setting the LocalTransactionCurrent service reference
37,266
protected void unsetLocalTransactionCurrent ( ServiceReference < LocalTransactionCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetLocalTransactionCurrent" , "unsetting " + ref ) ; } localTransactionCurrentRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the LocalTransactionCurrent service reference
37,267
protected void setEmbeddableWebSphereTransactionManager ( ServiceReference < EmbeddableWebSphereTransactionManager > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setEmbeddableWebSphereTransactionManager" , "setting " + ref ) ; } embeddableWebSphereTransactionManagerRef . setReference ( ref ) ; }
Declarative Services method for setting the EmbeddableWebSphereTransactionManager service reference
37,268
protected void unsetEmbeddableWebSphereTransactionManager ( ServiceReference < EmbeddableWebSphereTransactionManager > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetEmbeddableWebSphereTransactionManager" , "unsetting " + ref ) ; } embeddableWebSphereTransactionManagerRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the EmbeddableWebSphereTransactionManager service reference
37,269
protected void setUowCurrent ( ServiceReference < UOWCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setUowCurrent" , "setting " + ref ) ; } uowCurrentRef . setReference ( ref ) ; }
Declarative Services method for setting the UOWCurrent service reference
37,270
protected void unsetUowCurrent ( ServiceReference < UOWCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetUowCurrent" , "unsetting " + ref ) ; } uowCurrentRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the UOWCurrent service reference
37,271
protected void setUserTransaction ( ServiceReference < UserTransaction > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setUserTransaction" , "setting " + ref ) ; } userTransactionRef . setReference ( ref ) ; }
Declarative Services method for setting the UserTransaction service reference
37,272
protected void unsetUserTransaction ( ServiceReference < UserTransaction > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetUserTransaction" , "unsetting " + ref ) ; } userTransactionRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the UserTransaction service reference
37,273
protected void setSerializationService ( ServiceReference < SerializationService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setSerializationService" , "setting " + ref ) ; } serializationServiceRef . setReference ( ref ) ; }
Declarative Services method for setting the SerializationService service reference
37,274
protected void unsetSerializationService ( ServiceReference < SerializationService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetSerializationService" , "unsetting " + ref ) ; } serializationServiceRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the SerializationService service reference
37,275
private Connection getJdbcConnection ( ) throws JspCoreException , SQLException { Connection conn = null ; String url = getConnProperties ( ) . getUrl ( ) ; String user = getConnProperties ( ) . getLoginUser ( ) ; String passwd = getConnProperties ( ) . getLoginPasswd ( ) ; String jndiName = getConnProperties ( ) . getJndiName ( ) ; if ( jndiName == null ) { String dbDriver = ( getConnProperties ( ) ) . getDbDriver ( ) ; try { Class . forName ( dbDriver ) ; conn = DriverManager . getConnection ( url , user , passwd ) ; } catch ( ClassNotFoundException e ) { throw new JspCoreException ( JspConstants . InvalidDbDriver + dbDriver ) ; } } else { DataSource ds ; try { ds = getSingleton ( jndiName ) ; } catch ( Throwable th ) { throw new JspCoreException ( JspConstants . DatasourceException + th . getMessage ( ) ) ; } conn = ds . getConnection ( user , passwd ) ; } return conn ; }
Return a valid jdbc connection . if jndiName is specified then assume that we need to use a datasource else use a drivermanager
37,276
public static boolean isAbsolutePath ( String uri ) { boolean absolute = false ; if ( uri != null ) { if ( uri . indexOf ( ":/" ) != - 1 ) { absolute = true ; } else if ( uri . indexOf ( ":\\" ) != - 1 ) { absolute = true ; } } return absolute ; }
Checks to see if URI is absolute or relative .
37,277
private static boolean equalsHashes ( File fileToHash , String hashToCompare ) throws IOException { boolean result = false ; String fileHash = MD5Utils . getFileMD5String ( fileToHash ) ; if ( fileHash . equals ( hashToCompare ) ) result = true ; return result ; }
This method calculates a hash of the required file and compares it against the supplied hash . It then returns true if both hashes are equals .
37,278
private static Map < String , IFixInfo > processIFixXmls ( File wlpInstallationDirectory , Map < String , BundleFile > bundleFiles , CommandConsole console ) { Map < String , IFixInfo > filteredIfixInfos = new HashMap < String , IFixInfo > ( ) ; Map < String , UpdatedFile > latestIfixFiles = new HashMap < String , UpdatedFile > ( ) ; Set < IFixInfo > ifixInfos = getInstalledIFixes ( wlpInstallationDirectory , console ) ; for ( IFixInfo chkinfo : ifixInfos ) { for ( UpdatedFile updateFile : chkinfo . getUpdates ( ) . getFiles ( ) ) { String existingUpdateFileID ; String updateId = updateFile . getId ( ) ; if ( bundleFiles . containsKey ( updateId ) ) { existingUpdateFileID = getExistingMatchingIfixID ( bundleFiles . get ( updateId ) , latestIfixFiles . keySet ( ) , bundleFiles ) ; } else { existingUpdateFileID = updateId ; } UpdatedFile existingUpdateFile = latestIfixFiles . get ( existingUpdateFileID ) ; if ( existingUpdateFile != null ) { int dateComparison = updateFile . getDate ( ) . compareTo ( existingUpdateFile . getDate ( ) ) ; boolean replaceInMap = false ; if ( dateComparison > 0 ) replaceInMap = true ; else if ( dateComparison == 0 ) { IFixInfo existingFixInfo = filteredIfixInfos . get ( existingUpdateFileID ) ; List < Problem > existingProblems = existingFixInfo . getResolves ( ) . getProblems ( ) ; List < Problem > problems = chkinfo . getResolves ( ) . getProblems ( ) ; if ( existingProblems . size ( ) < problems . size ( ) ) replaceInMap = true ; } if ( replaceInMap ) { filteredIfixInfos . remove ( existingUpdateFileID ) ; latestIfixFiles . remove ( existingUpdateFileID ) ; filteredIfixInfos . put ( updateId , chkinfo ) ; latestIfixFiles . put ( updateId , updateFile ) ; } } else { filteredIfixInfos . put ( updateId , chkinfo ) ; latestIfixFiles . put ( updateId , updateFile ) ; } } } return filteredIfixInfos ; }
This method processes all of the ifix xml s and stores the latest version of each file found in a map . The comparisons on each file are based on the date associated with the file . The latest date means the latest update .
37,279
private static String getExistingMatchingIfixID ( BundleFile bundleFile , Set < String > existingIDs , Map < String , BundleFile > bundleFiles ) { String existingIfixKey = null ; for ( String existingID : existingIDs ) { if ( bundleFiles . containsKey ( existingID ) ) { BundleFile existingBundleFile = bundleFiles . get ( existingID ) ; if ( bundleFile . getSymbolicName ( ) . equals ( existingBundleFile . getSymbolicName ( ) ) ) { Version existingBundleVersion = new Version ( existingBundleFile . getVersion ( ) ) ; Version bundleVersion = new Version ( bundleFile . getVersion ( ) ) ; if ( bundleVersion . getMajor ( ) == existingBundleVersion . getMajor ( ) && bundleVersion . getMinor ( ) == existingBundleVersion . getMinor ( ) && bundleVersion . getMicro ( ) == existingBundleVersion . getMicro ( ) ) existingIfixKey = existingID ; } } } return existingIfixKey ; }
This method takes a ifix ID finds any existing IFix IDs that refer to the same base bundle . Because the ifix jars will have different qualifiers we need to be able to work out which ids are related .
37,280
private static Map < String , BundleFile > processLPMFXmls ( File wlpInstallationDirectory , CommandConsole console ) { Map < String , BundleFile > bundleFiles = new HashMap < String , BundleFile > ( ) ; for ( LibertyProfileMetadataFile chklpmf : getInstalledLibertyProfileMetadataFiles ( wlpInstallationDirectory , console ) ) { Bundles bundles = chklpmf . getBundles ( ) ; if ( bundles != null ) { List < BundleFile > bundleEntries = bundles . getBundleFiles ( ) ; if ( bundleEntries != null ) { for ( BundleFile bundleFile : bundleEntries ) { bundleFiles . put ( bundleFile . getId ( ) , bundleFile ) ; } } } } return bundleFiles ; }
This method processes all of the Liberty profile Metadata files stores the BundleFile objects containing the BundleSymbolic name and version of each bundle against the id of the file that matches the corresponding entry in the ifix . xml .
37,281
public static String getEntityType ( String accessId ) { Matcher m = matcher ( accessId ) ; if ( m != null ) { return m . group ( 1 ) ; } return null ; }
Given an accessId extract the entity type .
37,282
public static String getRealm ( String accessId ) { Matcher m = matcher ( accessId ) ; if ( m != null ) { return m . group ( 2 ) ; } return null ; }
Given an accessId extract the realm .
37,283
public static String getUniqueId ( String accessId ) { Matcher m = matcher ( accessId ) ; if ( m != null ) { return m . group ( 3 ) ; } return null ; }
Given an accessId extract the uniqueId .
37,284
public static String getUniqueId ( String accessId , String realm ) { if ( realm != null ) { Pattern pattern = Pattern . compile ( "([^:]+):(" + Pattern . quote ( realm ) + ")/(.*)" ) ; Matcher m = pattern . matcher ( accessId ) ; if ( m . matches ( ) ) { if ( m . group ( 3 ) . length ( ) > 0 ) { return m . group ( 3 ) ; } } } return getUniqueId ( accessId ) ; }
Given an accessId and realm name extract the uniqueId .
37,285
private String replaceNonAlpha ( String name ) { String modifiedName = null ; if ( p != null ) modifiedName = p . matcher ( name ) . replaceAll ( "_" ) ; return modifiedName ; }
Replace non - alphanumeric characters in a string with underscores .
37,286
public void setConsumerDispatcher ( ConsumerDispatcher consumerDispatcher ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setConsumerDispatcher" , consumerDispatcher ) ; this . consumerDispatcher = consumerDispatcher ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setConsumerDispatcher" ) ; }
Set the consumerDispatcher object to which this itemstream belongs
37,287
public void xmlWriteOn ( FormattedWriter writer ) throws IOException { if ( consumerDispatcher != null ) { writer . newLine ( ) ; writer . taggedValue ( "consumerDispatcher" , consumerDispatcher . toString ( ) ) ; } }
Prints debug information to the XML writer
37,288
public void deleteIfPossible ( boolean startAsynchThread ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteIfPossible" , new Boolean ( startAsynchThread ) ) ; _subscriptionLockManager . lockExclusive ( ) ; try { if ( destinationHandler == null ) { PubSubMessageItemStream mis = ( PubSubMessageItemStream ) getItemStream ( ) ; destinationHandler = ( DestinationHandler ) mis . getItemStream ( ) ; } if ( toBeDeleted || destinationHandler . isToBeDeleted ( ) ) { SIMPTransactionManager txManager = destinationHandler . getTxManager ( ) ; boolean complete = false ; try { Statistics statistics = null ; try { statistics = getStatistics ( ) ; } catch ( NotInMessageStore e ) { complete = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteIfPossible" , "Subscription already deleted" ) ; return ; } long countOfAvailableItems = statistics . getAvailableItemCount ( ) ; long countOfLockedMessages = statistics . getLockedItemCount ( ) ; if ( countOfAvailableItems > 0 || countOfLockedMessages > 0 ) { try { removeAllAvailableReferences ( ) ; } catch ( SIResourceException e1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteIfPossible" , e1 ) ; return ; } } statistics = getStatistics ( ) ; long countOfTotalItems = statistics . getTotalItemCount ( ) ; if ( countOfTotalItems == 0 ) { if ( destinationHandler . isToBeDeleted ( ) ) { destinationHandler . getDestinationManager ( ) . markDestinationAsCleanUpPending ( destinationHandler ) ; } try { PubSubMessageItemStream parentItemStream = ( PubSubMessageItemStream ) getItemStream ( ) ; remove ( txManager . createAutoCommitTransaction ( ) , NO_LOCK_ID ) ; parentItemStream . decrementReferenceStreamCount ( ) ; complete = true ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream.deleteIfPossible" , "1:364:1.54" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream" , "1:371:1.54" , e } ) ; } } } catch ( Exception e ) { SibTr . exception ( tc , e ) ; } finally { if ( ! complete ) { destinationHandler . getDestinationManager ( ) . addSubscriptionToDelete ( this ) ; if ( startAsynchThread ) destinationHandler . getDestinationManager ( ) . startAsynchDeletion ( ) ; } } } } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream.deleteIfPossible" , "1:400:1.54" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream" , "1:407:1.54" , e } ) ; } finally { _subscriptionLockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteIfPossible" ) ; return ; }
Method deleteIfPossible .
37,289
public void markAsToBeDeleted ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "markAsToBeDeleted" ) ; toBeDeleted = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "markAsToBeDeleted" ) ; }
Mark this itemstream as awaiting deletion
37,290
public void removeAllAvailableReferences ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeAllAvailableReferences" ) ; LocalTransaction transaction = null ; ItemReference itemReference = null ; try { PubSubMessageItemStream mis = ( PubSubMessageItemStream ) getItemStream ( ) ; DestinationHandler dh = ( DestinationHandler ) mis . getItemStream ( ) ; SIMPTransactionManager txManager = dh . getTxManager ( ) ; removingAvailableReferences = true ; if ( txManager != null ) { transaction = txManager . createLocalTransaction ( true ) ; int countOfItems = 0 ; do { do { itemReference = this . removeFirstMatching ( new DeliveryDelayDeleteFilter ( ) , ( Transaction ) transaction ) ; if ( itemReference != null ) countOfItems ++ ; } while ( ( itemReference != null ) && ( countOfItems < BATCH_DELETE_SIZE ) ) ; if ( countOfItems > 0 ) { transaction . commit ( ) ; if ( itemReference != null ) { transaction = txManager . createLocalTransaction ( true ) ; } countOfItems = 0 ; } } while ( itemReference != null ) ; } } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream.removeAllAvailableReferences" , "1:509:1.54" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream" , "1:516:1.54" , e } ) ; if ( transaction != null ) handleRollback ( transaction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeAllAvailableReferences" ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream" , "1:530:1.54" , e } , null ) , e ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream.removeAllAvailableReferences" , "1:540:1.54" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream" , "1:547:1.54" , e } ) ; if ( transaction != null ) handleRollback ( transaction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeAllAvailableReferences" ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.store.itemstreams.SubscriptionItemStream" , "1:561:1.54" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeAllAvailableReferences" ) ; }
Removes all available reference items from the reference stream in batches
37,291
public LockManager getSubscriptionLockManager ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getSubscriptionLockManager" ) ; SibTr . exit ( tc , "getSubscriptionLockManager" , _subscriptionLockManager ) ; } return _subscriptionLockManager ; }
Returns the lock manager associated with this subscription
37,292
private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { GetField fields = in . readFields ( ) ; failure = ( Throwable ) fields . get ( FAILURE , null ) ; previousResult = ( byte [ ] ) fields . get ( PREVIOUS_RESULT , null ) ; }
Deserialize information about the skipped execution .
37,293
private void writeObject ( ObjectOutputStream out ) throws IOException { PutField fields = out . putFields ( ) ; fields . put ( FAILURE , failure ) ; fields . put ( PREVIOUS_RESULT , previousResult ) ; out . writeFields ( ) ; }
Serialize information about the skipped execution .
37,294
public static < T > StaticValue < T > mutateStaticValue ( StaticValue < T > staticValue , Callable < T > initializer ) { if ( multiplex ) { if ( staticValue == null ) { staticValue = StaticValue . createStaticValue ( null ) ; } staticValue . initialize ( getThreadGroup ( ) , initializer ) ; return staticValue ; } return StaticValue . createStaticValue ( initializer ) ; }
Mutates a static value . Note that if not multiplexing then this method returns a new StaticValue object with the value as obtained by the initializer .
37,295
public static Object concat ( Object [ ] arrs ) { int totalLen = 0 ; Class commonComponentType = null ; for ( int i = 0 , len = arrs . length ; i < len ; i ++ ) { if ( arrs [ i ] == null ) { continue ; } int arrayLen = Array . getLength ( arrs [ i ] ) ; if ( arrayLen == 0 ) { continue ; } totalLen += arrayLen ; Class componentType = arrs [ i ] . getClass ( ) . getComponentType ( ) ; commonComponentType = ( commonComponentType == null ) ? componentType : commonClass ( commonComponentType , componentType ) ; } if ( commonComponentType == null ) { return null ; } return concat ( Array . newInstance ( commonComponentType , totalLen ) , totalLen , arrs ) ; }
Concatenates arrays into one . Any null or empty arrays are ignored . If all arrays are null or empty returns null . Elements will be ordered in the order in which the arrays are supplied .
37,296
public int compare ( T entity1 , T entity2 ) { SortHandler shandler = new SortHandler ( sortControl ) ; return shandler . compareEntitysWithRespectToProperties ( ( Entity ) entity1 , ( Entity ) entity2 ) ; }
Compares its two objects for order . Returns a negative integer zero or a positive integer as the first argument is less than equal to or greater than the second .
37,297
public void dump ( ) { if ( ! tc . isDumpEnabled ( ) ) { return ; } Enumeration vEnum = lockTable . keys ( ) ; Tr . dump ( tc , "-- Lock Manager Dump --" ) ; while ( vEnum . hasMoreElements ( ) ) { Object key = vEnum . nextElement ( ) ; Tr . dump ( tc , "lock table entry" , new Object [ ] { key , lockTable . get ( key ) } ) ; } }
Dump internal state of lock manager .
37,298
protected Commandline getCommandline ( ) { Commandline cmdl = new Commandline ( ) ; if ( configFile != null ) { cmdl . createArgument ( ) . setValue ( "--config" ) ; cmdl . createArgument ( ) . setFile ( configFile ) ; } if ( debug ) { cmdl . createArgument ( ) . setValue ( "--debug" ) ; } return cmdl ; }
Get the command line configuration arguments for the StaticTraceInstrumentation invocations .
37,299
public void execute ( ) { List < File > flist = new ArrayList < File > ( ) ; if ( file != null ) { flist . add ( file ) ; } for ( int i = 0 ; i < filesets . size ( ) ; i ++ ) { FileSet fs = filesets . elementAt ( i ) ; DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ; File dir = fs . getDir ( getProject ( ) ) ; String [ ] includedFiles = ds . getIncludedFiles ( ) ; for ( String s : Arrays . asList ( includedFiles ) ) { flist . add ( new File ( dir , s ) ) ; } } Commandline cmdl = getCommandline ( ) ; for ( File f : flist ) { cmdl . createArgument ( ) . setFile ( f ) ; } AbstractInstrumentation inst ; try { inst = createInstrumentation ( ) ; if ( cmdl . size ( ) == 0 ) { return ; } inst . processArguments ( cmdl . getArguments ( ) ) ; inst . processPackageInfo ( ) ; } catch ( Exception t ) { getProject ( ) . log ( this , "Invalid class files or jars specified " + t , Project . MSG_ERR ) ; if ( failOnError ) { getProject ( ) . log ( "Instrumentation Failed" , t , Project . MSG_ERR ) ; throw new BuildException ( "InstrumentationFailed" , t ) ; } else { return ; } } List < File > classFiles = inst . getClassFiles ( ) ; List < File > jarFiles = inst . getJarFiles ( ) ; boolean instrumentationErrors = false ; for ( File f : classFiles ) { try { log ( "Instrumenting class " + f , verbosity ) ; inst . instrumentClassFile ( f ) ; } catch ( Throwable t ) { boolean instrumentationError = t instanceof InstrumentationException ; if ( failOnError && ! instrumentationError ) { throw new BuildException ( "Instrumentation of class " + f + " failed" , t ) ; } else { String reason = "" ; if ( instrumentationError ) { reason = ": " + t . getMessage ( ) ; instrumentationErrors = true ; } getProject ( ) . log ( this , "Unable to instrument class " + f + reason , Project . MSG_WARN ) ; } } } for ( File f : jarFiles ) { try { log ( "Instrumenting archive file " + f , verbosity ) ; inst . instrumentZipFile ( f ) ; } catch ( Throwable t ) { if ( failOnError ) { throw new BuildException ( "InstrumentationFailed" , t ) ; } else { getProject ( ) . log ( this , "Unable to instrument archive " + f , Project . MSG_WARN ) ; } } } if ( instrumentationErrors ) { throw new BuildException ( "Instrumentation of classes failed" ) ; } }
Execute the build task .