idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
37,800
|
public final void commit_one_phase ( ) throws XAException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "commit_one_phase" , _resource ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "commit_one_phase" , this ) ; try { _resource . commit ( _xid , true ) ; _completedCommit = true ; _vote = JTAResourceVote . commit ; } catch ( XAException xae ) { _completionXARC = xae . errorCode ; throw xae ; } finally { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "commit_one_phase" , _completionXARC ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "commit_one_phase result: " + XAReturnCodeHelper . convertXACode ( _completionXARC ) ) ; } }
|
Commit a transaction using one - phase optimization .
|
37,801
|
public final void rollback ( ) throws XAException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "rollback" , _resource ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "rollback" , this ) ; try { _resource . rollback ( _xid ) ; _vote = JTAResourceVote . rollback ; } catch ( XAException xae ) { _completionXARC = xae . errorCode ; throw xae ; } finally { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "rollback" ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "rollback result: " + XAReturnCodeHelper . convertXACode ( _completionXARC ) ) ; } }
|
Rollback a transaction .
|
37,802
|
public final void forget ( ) throws XAException { if ( tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "forget" , _resource ) ; Tr . exit ( tc , "forget" ) ; } }
|
The resource manager can forget all knowledge of the transaction . Only allowed because commit_one_phase may return heuristic
|
37,803
|
private void verifyConfiguration ( ) throws DeploymentException { Map < URL , ModuleMetaData > mmds = getModuleMetaDataMap ( ) ; if ( mmds != null ) { for ( Map . Entry < URL , ModuleMetaData > entry : mmds . entrySet ( ) ) { ModuleMetaData mmd = entry . getValue ( ) ; if ( mmd instanceof WebModuleMetaData ) { String j2eeModuleName = mmd . getJ2EEName ( ) . getModule ( ) ; Map < Class < ? > , Properties > authMechs = getAuthMechs ( j2eeModuleName ) ; if ( authMechs != null && ! authMechs . isEmpty ( ) ) { if ( authMechs . size ( ) != 1 ) { String appName = mmd . getJ2EEName ( ) . getApplication ( ) ; String authMechNames = getAuthMechNames ( authMechs ) ; Tr . error ( tc , "JAVAEESEC_CDI_ERROR_MULTIPLE_HTTPAUTHMECHS" , j2eeModuleName , appName , authMechNames ) ; String msg = Tr . formatMessage ( tc , "JAVAEESEC_CDI_ERROR_MULTIPLE_HTTPAUTHMECHS" , j2eeModuleName , appName , authMechNames ) ; throw new DeploymentException ( msg ) ; } SecurityMetadata smd = ( SecurityMetadata ) ( ( WebModuleMetaData ) mmd ) . getSecurityMetaData ( ) ; if ( smd != null ) { LoginConfiguration lc = smd . getLoginConfiguration ( ) ; if ( lc != null && ! lc . isAuthenticationMethodDefaulted ( ) ) { String appName = mmd . getJ2EEName ( ) . getApplication ( ) ; String msg = Tr . formatMessage ( tc , "JAVAEESEC_CDI_ERROR_LOGIN_CONFIG_EXISTS" , j2eeModuleName , appName ) ; Tr . error ( tc , "JAVAEESEC_CDI_ERROR_LOGIN_CONFIG_EXISTS" , j2eeModuleName , appName ) ; throw new DeploymentException ( msg ) ; } } } } } } }
|
make sure that there is one HAM for each modules and if there is a HAM in a module make sure there is no login configuration in web . xml .
|
37,804
|
private String getModuleFromClass ( Class < ? > klass , Map < String , ModuleProperties > moduleMap ) { String file = getClassFileLocation ( klass ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "File name : " + file ) ; } String moduleName = null ; for ( Map . Entry < String , ModuleProperties > entry : moduleMap . entrySet ( ) ) { URL location = entry . getValue ( ) . getLocation ( ) ; String filePath = location . getFile ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "location : " + filePath ) ; } if ( location . getProtocol ( ) . equals ( "file" ) && file . startsWith ( filePath ) ) { moduleName = entry . getKey ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "module name from the list : " + moduleName ) ; } break ; } } if ( moduleName == null ) { moduleName = file ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "no match. use filename as module name : " + moduleName ) ; } } return moduleName ; }
|
Identify the module name from the class . If the class exists in the jar file return war file name if it is located under the war file otherwise returning jar file name .
|
37,805
|
private Properties getGlobalLoginBasicProps ( ) throws Exception { String realm = getWebAppSecurityConfig ( ) . getBasicAuthRealmName ( ) ; Properties props = new Properties ( ) ; if ( realm == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "basicAuthenticationMechanismRealmName is not set. the default value " + JavaEESecConstants . DEFAULT_REALM + " is used." ) ; } } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The container provided BasicAuthenticationMechanism will be used with the realm name : " + realm ) ; } props . put ( JavaEESecConstants . REALM_NAME , realm ) ; } return props ; }
|
Returns BasicAuth realm name for container override basic login
|
37,806
|
private Properties getGlobalLoginFormProps ( ) throws Exception { WebAppSecurityConfig webAppSecConfig = getWebAppSecurityConfig ( ) ; String loginURL = webAppSecConfig . getLoginFormURL ( ) ; String errorURL = webAppSecConfig . getLoginErrorURL ( ) ; if ( loginURL == null || loginURL . isEmpty ( ) ) { Tr . error ( tc , "JAVAEESEC_CDI_ERROR_NO_URL" , "loginFormURL" ) ; } if ( errorURL == null || errorURL . isEmpty ( ) ) { Tr . error ( tc , "JAVAEESEC_CDI_ERROR_NO_URL" , "loginErrorURL" ) ; } String contextRoot = webAppSecConfig . getLoginFormContextRoot ( ) ; if ( contextRoot == null ) { contextRoot = getFirstPathElement ( loginURL ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loginFormContextRoot is not set, use the first element of loginURL : " + contextRoot ) ; } } else { if ( ! validateContextRoot ( contextRoot , loginURL ) ) { Tr . error ( tc , "JAVAEESEC_CDI_ERROR_INVALID_CONTEXT_ROOT" , contextRoot , loginURL , "loginFormURL" ) ; } if ( ! validateContextRoot ( contextRoot , errorURL ) ) { Tr . error ( tc , "JAVAEESEC_CDI_ERROR_INVALID_CONTEXT_ROOT" , contextRoot , errorURL , "loginErrorURL" ) ; } } loginURL = FixUpUrl ( loginURL , contextRoot ) ; errorURL = FixUpUrl ( errorURL , contextRoot ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The container provided FormAuthenticationMechanism will be used with the following attributes. login page : " + loginURL + ", error page : " + errorURL + ", context root : " + contextRoot ) ; } Properties props = new Properties ( ) ; if ( loginURL != null ) { props . put ( JavaEESecConstants . LOGIN_TO_CONTINUE_LOGINPAGE , loginURL ) ; } if ( errorURL != null ) { props . put ( JavaEESecConstants . LOGIN_TO_CONTINUE_ERRORPAGE , errorURL ) ; } props . put ( JavaEESecConstants . LOGIN_TO_CONTINUE_USEFORWARDTOLOGIN , true ) ; props . put ( JavaEESecConstants . LOGIN_TO_CONTINUE_USE_GLOBAL_LOGIN , true ) ; if ( contextRoot != null ) { props . put ( JavaEESecConstants . LOGIN_TO_CONTINUE_LOGIN_FORM_CONTEXT_ROOT , contextRoot ) ; } return props ; }
|
Returns LoginToContinue properties for container override form login
|
37,807
|
private void initialize ( Map < String , Object > metadata ) { if ( metadata == null ) { metadata = new HashMap < String , Object > ( ) ; } metadata . put ( REQUEST_ID , generateRequestID ( ) ) ; this . metadata = metadata ; }
|
Generates a new metadata Map if none is given . Generates and adds a request ID to the metadata .
|
37,808
|
public void addObserver ( Observer observer ) { super . addObserver ( observer ) ; if ( countObservers ( ) > 1 ) { super . deleteObserver ( observer ) ; AbstractConnectionFactoryService cfSvc = ( AbstractConnectionFactoryService ) observer ; Object [ ] params = new Object [ ] { CONNECTION_MANAGER , name , cfSvc . getConfigElementName ( ) } ; RuntimeException failure = connectorSvc . ignoreWarnOrFail ( tc , null , UnsupportedOperationException . class , "CARDINALITY_ERROR_J2CA8040" , params ) ; if ( failure != null ) throw failure ; } }
|
Add an observer for this connection manager service .
|
37,809
|
public void destroyConnectionFactories ( ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) { final String pmName ; if ( pm != null ) pmName = pm . getUniqueId ( ) ; else pmName = "factory name not avaiable" ; Tr . entry ( this , tc , "destroyConnectionFactories" , pmName ) ; } lock . writeLock ( ) . lock ( ) ; try { if ( pmMBean != null ) { pmMBean . unregister ( ) ; pmMBean = null ; } if ( pm != null ) { try { pm . serverShutDown ( ) ; pm = null ; cfKeyToCM . clear ( ) ; } catch ( Throwable x ) { FFDCFilter . processException ( x , getClass ( ) . getName ( ) , "263" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , x . getMessage ( ) , CommonFunction . stackTraceToString ( x ) ) ; } } } finally { lock . writeLock ( ) . unlock ( ) ; } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "destroyConnectionFactories" ) ; }
|
Destroy all connection factories that are using this connection manager service .
|
37,810
|
private final CMConfigData getCMConfigData ( AbstractConnectionFactoryService cfSvc , ResourceInfo refInfo ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getCMConfigData" ) ; int auth = J2CConstants . AUTHENTICATION_APPLICATION ; int branchCoupling = ResourceRefInfo . BRANCH_COUPLING_UNSET ; int commitPriority = 0 ; int isolation = Connection . TRANSACTION_NONE ; int sharingScope ; String loginConfigName = null ; HashMap < String , String > loginConfigProps = null ; String resRefName = null ; if ( refInfo != null ) { if ( refInfo . getAuth ( ) == ResourceRef . AUTH_CONTAINER ) auth = J2CConstants . AUTHENTICATION_CONTAINER ; branchCoupling = refInfo . getBranchCoupling ( ) ; commitPriority = refInfo . getCommitPriority ( ) ; isolation = refInfo . getIsolationLevel ( ) ; loginConfigName = refInfo . getLoginConfigurationName ( ) ; loginConfigProps = toHashMap ( refInfo . getLoginPropertyList ( ) ) ; resRefName = refInfo . getName ( ) ; sharingScope = refInfo . getSharingScope ( ) ; } else { if ( properties != null ) { Object enableSharingForDirectLookups = properties . get ( "enableSharingForDirectLookups" ) ; sharingScope = enableSharingForDirectLookups == null || ( Boolean ) enableSharingForDirectLookups ? ResourceRefInfo . SHARING_SCOPE_SHAREABLE : ResourceRefInfo . SHARING_SCOPE_UNSHAREABLE ; } else { sharingScope = ResourceRefInfo . SHARING_SCOPE_SHAREABLE ; } } CMConfigData cmConfig = new CMConfigDataImpl ( cfSvc . getJNDIName ( ) , sharingScope , isolation , auth , cfSvc . getID ( ) , loginConfigName , loginConfigProps , resRefName , commitPriority , branchCoupling , null ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getCMConfigData" , cmConfig ) ; return cmConfig ; }
|
Construct the CMConfigData including properties from the resource reference if applicable .
|
37,811
|
public ConnectionManager getConnectionManager ( ResourceInfo refInfo , AbstractConnectionFactoryService svc ) throws ResourceException { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getConnectionManager" , refInfo , svc ) ; ConnectionManager cm ; lock . readLock ( ) . lock ( ) ; try { if ( pm == null ) try { lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; if ( pm == null ) createPoolManager ( svc ) ; } finally { lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } CMConfigData cmConfigData = getCMConfigData ( svc , refInfo ) ; String cfDetailsKey = cmConfigData . getCFDetailsKey ( ) ; cm = cfKeyToCM . get ( cfDetailsKey ) ; if ( cm == null ) { CommonXAResourceInfo xaResInfo = new EmbXAResourceInfo ( cmConfigData ) ; J2CGlobalConfigProperties gConfigProps = pm . getGConfigProps ( ) ; synchronized ( this ) { cm = cfKeyToCM . get ( cfDetailsKey ) ; if ( cm == null ) { cm = new ConnectionManager ( svc , pm , gConfigProps , xaResInfo ) ; cfKeyToCM . put ( cfDetailsKey , cm ) ; } } } } finally { lock . readLock ( ) . unlock ( ) ; } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getConnectionManager" , cm ) ; return cm ; }
|
Returns the connection manager for this configuration . This method lazily initializes the connection manager service if necessary .
|
37,812
|
private final static HashMap < String , String > toHashMap ( List < ? extends ResourceInfo . Property > propList ) { if ( propList == null ) return null ; HashMap < String , String > propMap = new HashMap < String , String > ( ) ; for ( ResourceInfo . Property prop : propList ) propMap . put ( prop . getName ( ) , prop . getValue ( ) ) ; return propMap ; }
|
Utility method that converts a list of properties to HashMap .
|
37,813
|
@ FFDCIgnore ( BAD_OPERATION . class ) public Object narrow ( Object narrowFrom , @ SuppressWarnings ( "rawtypes" ) Class narrowTo ) throws ClassCastException { if ( narrowFrom == null ) { return null ; } if ( narrowTo . isInstance ( narrowFrom ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "object is already an instance" ) ; return narrowFrom ; } if ( ! ! ! ( narrowFrom instanceof ObjectImpl ) ) throw new ClassCastException ( narrowTo . getName ( ) ) ; if ( IDLEntity . class . isAssignableFrom ( narrowTo ) ) return super . narrow ( narrowFrom , narrowTo ) ; Class < ? > stubClass = loadStubClass ( narrowTo ) ; if ( stubClass == null ) { return super . narrow ( narrowFrom , narrowTo ) ; } Object stubObject ; try { stubObject = stubClass . newInstance ( ) ; } catch ( Throwable t ) { ClassCastException e = new ClassCastException ( narrowTo . getName ( ) ) ; e . initCause ( t ) ; throw e ; } Stub stub = ( Stub ) stubObject ; try { stub . _set_delegate ( ( ( ObjectImpl ) narrowFrom ) . _get_delegate ( ) ) ; } catch ( org . omg . CORBA . BAD_OPERATION e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unable to copy delegate" , e ) ; } return narrowTo . cast ( stub ) ; }
|
An implementation of narrow that always attempts to load stub classes from the class loader before dynamically generating a stub class .
|
37,814
|
private void scanClasses ( ) throws PersistenceUnitScannerException { try { for ( URL url : urlSet ) { final HashSet < ClassInfoType > citSet = new HashSet < ClassInfoType > ( ) ; final String urlProtocol = url . getProtocol ( ) ; if ( "file" . equalsIgnoreCase ( urlProtocol ) ) { final Path taPath = Paths . get ( url . toURI ( ) ) ; if ( Files . isDirectory ( taPath ) ) { citSet . addAll ( processExplodedJarFormat ( taPath ) ) ; } else { citSet . addAll ( processUnexplodedFile ( taPath ) ) ; } } else if ( url . toString ( ) . startsWith ( "jar:file" ) ) { citSet . addAll ( processJarFileURL ( url ) ) ; } else { citSet . addAll ( processJarFormatInputStreamURL ( url ) ) ; } processInnerClasses ( citSet ) ; scannedClassesMap . put ( url , citSet ) ; } } catch ( Exception e ) { FFDCFilter . processException ( e , PersistenceUnitScanner . class . getName ( ) + ".scanClasses" , "118" ) ; throw new PersistenceUnitScannerException ( e ) ; } }
|
Scan classes in persistence unit root and referenced jar - files
|
37,815
|
private void scanEntityMappings ( ) throws PersistenceUnitScannerException { final HashSet < URL > mappingFilesLocated = new HashSet < URL > ( ) ; final HashSet < String > searchNames = new HashSet < String > ( ) ; for ( PersistenceUnitInfo pui : puiList ) { try { mappingFilesLocated . clear ( ) ; searchNames . clear ( ) ; searchNames . add ( "META-INF/orm.xml" ) ; if ( pui . getMappingFileNames ( ) != null ) { searchNames . addAll ( pui . getMappingFileNames ( ) ) ; } for ( String mappingFile : searchNames ) { mappingFilesLocated . addAll ( findORMResources ( pui , mappingFile ) ) ; } final List < EntityMappingsDefinition > parsedOrmList = pu_ormFileParsed_map . get ( pui ) ; pu_ormFiles_map . get ( pui ) . addAll ( mappingFilesLocated ) ; for ( final URL mappingFileURL : mappingFilesLocated ) { if ( scanned_ormfile_map . containsKey ( mappingFileURL ) ) { parsedOrmList . add ( scanned_ormfile_map . get ( mappingFileURL ) ) ; continue ; } EntityMappingsDefinition emapdef = EntityMappingsFactory . parseEntityMappings ( mappingFileURL ) ; parsedOrmList . add ( emapdef ) ; scanned_ormfile_map . put ( mappingFileURL , emapdef ) ; } } catch ( Exception e ) { FFDCFilter . processException ( e , PersistenceUnitScanner . class . getName ( ) + ".scanEntityMappings" , "460" ) ; throw new PersistenceUnitScannerException ( e ) ; } } }
|
Scan Entity Mappings Files
|
37,816
|
private List < URL > findORMResources ( PersistenceUnitInfo pui , String ormFileName ) throws IOException { final boolean isMetaInfoOrmXML = "META-INF/orm.xml" . equals ( ormFileName ) ; final ArrayList < URL > retArr = new ArrayList < URL > ( ) ; Enumeration < URL > ormEnum = pui . getClassLoader ( ) . getResources ( ormFileName ) ; while ( ormEnum . hasMoreElements ( ) ) { final URL url = ormEnum . nextElement ( ) ; final String urlExtern = url . toExternalForm ( ) ; if ( ! isMetaInfoOrmXML ) { retArr . add ( url ) ; continue ; } if ( urlExtern . startsWith ( pui . getPersistenceUnitRootUrl ( ) . toExternalForm ( ) ) ) { retArr . add ( url ) ; continue ; } for ( URL jarUrl : pui . getJarFileUrls ( ) ) { final String jarExtern = jarUrl . toExternalForm ( ) ; if ( urlExtern . startsWith ( jarExtern ) ) { retArr . add ( url ) ; continue ; } } } return retArr ; }
|
Finds all specified ORM files by name constrained in location by the persistence unit root and jar files .
|
37,817
|
public boolean writeSilence ( SIMPMessage m ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "writeSilence" , new Object [ ] { m } ) ; JsMessage jsMsg = m . getMessage ( ) ; long stamp = jsMsg . getGuaranteedValueValueTick ( ) ; long starts = jsMsg . getGuaranteedValueStartTick ( ) ; long ends = jsMsg . getGuaranteedValueEndTick ( ) ; if ( ends < stamp ) ends = stamp ; TickRange tr = new TickRange ( TickRange . Completed , starts , ends ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "writeSilence from: " + starts + " to " + ends + " on Stream " + streamID ) ; } synchronized ( this ) { tr = oststream . writeCompletedRange ( tr ) ; long completedPrefix = oststream . getCompletedPrefix ( ) ; if ( completedPrefix > oack ) { oack = completedPrefix ; } if ( lastSent > ends ) sendSilence ( ends + 1 , completedPrefix ) ; if ( blockedStreamAlarm != null ) blockedStreamAlarm . checkState ( false ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilence" ) ; setLastSent ( jsMsg . getGuaranteedValueEndTick ( ) ) ; return true ; }
|
This method uses a Value message to write Silence into the stream either because a message has been filtered out or because it has been rolled back
|
37,818
|
public void writeSilence ( ControlSilence m ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "writeSilence" , new Object [ ] { m } ) ; boolean sendMessage = false ; long completedPrefix ; long starts = m . getStartTick ( ) ; long ends = m . getEndTick ( ) ; boolean requestedOnly = m . getRequestedOnly ( ) ; TickRange tr = new TickRange ( TickRange . Completed , starts , ends ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "writeSilence from: " + starts + " to " + ends + " on Stream " + streamID ) ; } synchronized ( this ) { if ( requestedOnly ) { if ( oststream . containsRequested ( tr ) == false ) sendMessage = false ; } tr = oststream . writeCompletedRange ( tr ) ; if ( oststream . getCompletedPrefix ( ) > oack ) { oack = oststream . getCompletedPrefix ( ) ; } completedPrefix = oststream . getCompletedPrefix ( ) ; } if ( sendMessage ) { try { downControl . sendSilenceMessage ( tr . startstamp , tr . endstamp , completedPrefix , requestedOnly , priority , reliability , streamID ) ; } catch ( SIResourceException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.gd.InternalOutputStream.writeSilence" , "1:788:1.83.1.1" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilence" , e ) ; throw e ; } setLastSent ( tr . endstamp ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilence" , Boolean . valueOf ( sendMessage ) ) ; }
|
This method writes the ticks in a Silence message into the stream It is called when a Silence message arrives from another ME If the RequestedOnly flag in the message is set then the message is only sent on to downstream MEs if they have previously requested it . Otherwise it is always sent .
|
37,819
|
public void writeAckPrefix ( long stamp ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "writeAckPrefix" , Long . valueOf ( stamp ) ) ; synchronized ( this ) { if ( stamp >= lastAckExpTick ) { getControlAdapter ( ) . getHealthState ( ) . updateHealth ( HealthStateListener . ACK_EXPECTED_STATE , HealthState . GREEN ) ; lastAckExpTick = Long . MAX_VALUE ; } if ( stamp >= lastNackReceivedTick ) { getControlAdapter ( ) . getHealthState ( ) . updateHealth ( HealthStateListener . NACK_RECEIVED_STATE , HealthState . GREEN ) ; lastNackReceivedTick = Long . MAX_VALUE ; } if ( stamp > ack ) ack = stamp ; oststream . setCompletedPrefix ( stamp ) ; long newCompletedPrefix = oststream . getCompletedPrefix ( ) ; if ( newCompletedPrefix > oack ) { oack = newCompletedPrefix ; upControl . sendAckMessage ( null , null , null , newCompletedPrefix , priority , reliability , streamID , false ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeAckPrefix" ) ; } }
|
This method is called when an Ack message is recieved from a downstream ME . It updates the ackPrefix of the stream and then passes the message up to the PubSubInputHandler which will aggregate the Acks from all InternalOutputStreams .
|
37,820
|
public void writeSilenceForced ( TickRange vtr ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "writeSilenceForced" , new Object [ ] { vtr } ) ; long start = vtr . startstamp ; long end = vtr . endstamp ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "writeSilenceForced from: " + start + " to " + end + " on Stream " + streamID ) ; } TickRange tr = new TickRange ( TickRange . Completed , start , end ) ; synchronized ( this ) { tr = oststream . writeCompletedRangeForced ( tr ) ; try { if ( tr . startstamp == 0 ) { writeAckPrefix ( tr . endstamp ) ; } } catch ( SIResourceException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.gd.InternalOutputStream.writeSilenceForced" , "1:1273:1.83.1.1" , this ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilenceForced" ) ; }
|
This method uses a Value TickRange to write Silence into the stream because a message has expired before it was sent and so needs to be removed from the stream It forces the stream to be updated to Silence without checking the existing state It then updates the upstream control with this new completed prefix
|
37,821
|
public static final byte [ ] serialize ( Serializable serializable ) throws IOException { if ( serializable == null ) { return null ; } ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; ObjectOutputStream objectOutputStream = null ; byte [ ] result = null ; if ( null != _instance ) { SerializationService ss = _instance . serializationServiceRef . getService ( ) ; if ( null != ss ) { objectOutputStream = ss . createObjectOutputStream ( byteArrayOutputStream ) ; } } if ( null == objectOutputStream ) { objectOutputStream = new ObjectOutputStream ( byteArrayOutputStream ) ; } try { objectOutputStream . writeObject ( serializable ) ; result = byteArrayOutputStream . toByteArray ( ) ; } finally { if ( byteArrayOutputStream != null ) { byteArrayOutputStream . close ( ) ; } if ( objectOutputStream != null ) { objectOutputStream . close ( ) ; } } return result ; }
|
This serializes an object into a byte array .
|
37,822
|
public Object nextElement ( ) { try { return nextElementR ( ) ; } catch ( NoMoreElementsException e ) { throw new NoSuchElementException ( ) ; } catch ( EnumeratorException e ) { throw new RuntimeException ( e . toString ( ) ) ; } catch ( NoSuchObjectException e ) { throw new IllegalStateException ( "Cannot access finder result outside transaction" ) ; } catch ( RemoteException e ) { throw new RuntimeException ( e . toString ( ) ) ; } }
|
Obtain the next element from the enumeration
|
37,823
|
public boolean hasMoreElements ( ) { try { return hasMoreElementsR ( ) ; } catch ( NoMoreElementsException e ) { return false ; } catch ( EnumeratorException e ) { throw new RuntimeException ( e . toString ( ) ) ; } catch ( NoSuchObjectException e ) { throw new IllegalStateException ( "Cannot access finder result outside transaction" ) ; } catch ( RemoteException e ) { throw new RuntimeException ( e . toString ( ) ) ; } }
|
Find out if there are any more elements available
|
37,824
|
public synchronized boolean hasMoreElementsR ( ) throws RemoteException , EnumeratorException { if ( elements != null && index < elements . length ) { return true ; } else if ( ! exhausted ) { try { elements = null ; index = 0 ; elements = fetchElements ( PREFETCH_COUNT ) ; return true ; } catch ( NoMoreElementsException ex ) { return false ; } } return false ; }
|
Find out if there are any more elements available ; this method will perform prefetching from the remote result set .
|
37,825
|
public synchronized Object [ ] nextNElements ( int n ) throws RemoteException , EnumeratorException { if ( ! hasMoreElementsR ( ) ) { throw new NoMoreElementsException ( ) ; } EJBObject [ ] remainder = null ; final int numCached = elements . length - index ; if ( ! exhausted && numCached < n ) { try { remainder = fetchElements ( n - numCached ) ; } catch ( NoMoreElementsException ex ) { } } final int numRemaining = remainder != null ? remainder . length : 0 ; final int totalAvail = numCached + numRemaining ; final int numToReturn = Math . min ( n , totalAvail ) ; final EJBObject [ ] result = new EJBObject [ numToReturn ] ; final int numFromCache = Math . min ( numToReturn , numCached ) ; System . arraycopy ( elements , index , result , 0 , numFromCache ) ; index += numFromCache ; if ( remainder != null ) { System . arraycopy ( remainder , 0 , result , numFromCache , numRemaining ) ; } return result ; }
|
Obtain the next n elements from the enumeration ; the array may contain fewer than n elements if the enumeration is exhausted .
|
37,826
|
public EJBObject [ ] loadEntireCollection ( ) { EJBObject [ ] result = null ; try { result = ( EJBObject [ ] ) allRemainingElements ( ) ; } catch ( NoMoreElementsException e ) { return elements ; } catch ( EnumeratorException e ) { throw new RuntimeException ( e . toString ( ) ) ; } catch ( RemoteException e ) { throw new RuntimeException ( e . toString ( ) ) ; } elements = result ; return result ; }
|
Load the entire result set in a greedy fashion . This is required to support methods on the Collection interface
|
37,827
|
public synchronized Object [ ] allRemainingElements ( ) throws RemoteException , EnumeratorException { if ( ! hasMoreElementsR ( ) ) { throw new NoMoreElementsException ( ) ; } EJBObject [ ] remainder = null ; if ( ! exhausted ) { try { remainder = vEnum . allRemainingElements ( ) ; } catch ( NoMoreElementsException ex ) { } catch ( java . rmi . NoSuchObjectException exc ) { throw new com . ibm . ejs . container . finder . CollectionCannotBeFurtherAccessedException ( "Cannot access finder result outside transaction" ) ; } finally { exhausted = true ; vEnum = null ; } } final int numCached = elements . length - index ; final int numRemaining = remainder != null ? remainder . length : 0 ; final EJBObject [ ] result = new EJBObject [ numCached + numRemaining ] ; System . arraycopy ( elements , index , result , 0 , numCached ) ; if ( remainder != null ) { System . arraycopy ( remainder , 0 , result , numCached , numRemaining ) ; } elements = null ; return result ; }
|
Obtain all of the remaining elements from the enumeration
|
37,828
|
void extractPersistenceUnits ( JPAPXml pxml ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "extractPersistenceUnits : " + pxml ) ; JaxbPersistence p = JaxbUnmarshaller . unmarshal ( pxml ) ; List < JaxbPUnit > pus = p . getPersistenceUnit ( ) ; for ( JaxbPUnit pu : pus ) { String puName = pu . getName ( ) ; JPAApplInfo applInfo = pxml . getApplInfo ( ) ; JPAPuId puId = new JPAPuId ( applInfo . getApplName ( ) , pxml . getArchiveName ( ) , puName ) ; JPAPUnitInfo puInfo = applInfo . createJPAPUnitInfo ( puId , pxml , ivScopeInfo ) ; puInfo . setPersistenceXMLSchemaVersion ( p . getVersion ( ) ) ; puInfo . setPersistenceUnitRootUrl ( pxml . getRootURL ( ) ) ; puInfo . setTransactionType ( pu . getTransactionType ( ) ) ; puInfo . setPersistenceUnitDescription ( pu . getDescription ( ) ) ; puInfo . setPersistenceProviderClassName ( pu . getProvider ( ) ) ; puInfo . setJtaDataSource ( pu . getJtaDataSource ( ) ) ; puInfo . setNonJtaDataSource ( pu . getNonJtaDataSource ( ) ) ; puInfo . setMappingFileNames ( pu . getMappingFile ( ) ) ; puInfo . setJarFileUrls ( pu . getJarFile ( ) , pxml ) ; puInfo . setManagedClassNames ( pu . getClazz ( ) ) ; puInfo . setSharedCacheMode ( pu . getSharedCacheMode ( ) ) ; puInfo . setValidationMode ( pu . getValidationMode ( ) ) ; puInfo . setExcludeUnlistedClasses ( pu . isExcludeUnlistedClasses ( ) ) ; puInfo . setProperties ( pu . getProperties ( ) ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) { String rootURLStr = pxml . getRootURL ( ) . getFile ( ) ; int earIndex = rootURLStr . indexOf ( applInfo . getApplName ( ) + ".ear" ) ; if ( earIndex != - 1 ) { rootURLStr = rootURLStr . substring ( earIndex + applInfo . getApplName ( ) . length ( ) + 5 ) ; } rootURLStr += PERSISTENCE_XML_RESOURCE_NAME ; Tr . debug ( tc , "extractPersistenceUnits : " + applInfo . getApplName ( ) + "|" + pxml . getArchiveName ( ) + "|" + rootURLStr + "|" + puInfo . getPersistenceUnitName ( ) + "|" + ivScopeInfo . getScopeType ( ) + "|" + puInfo . dump ( ) ) ; } if ( getPuInfo ( puName ) != null ) { Tr . warning ( tc , "DUPLICATE_PERSISTENCE_UNIT_DEFINED_CWWJP0007W" , puName , applInfo . getApplName ( ) , pxml . getArchiveName ( ) ) ; puInfo . close ( ) ; } else { addPU ( puName , puInfo ) ; puInfo . initialize ( ) ; } JPAIntrospection . visitJPAPUnitInfo ( puName , puInfo ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "extractPersistenceUnits : # of PU defined = " + getPuCount ( ) ) ; }
|
Populates the list of persistence units defined in this persistence . xml .
|
37,829
|
void close ( ) { synchronized ( ivPuList ) { for ( JPAPUnitInfo puInfo : ivPuList . values ( ) ) { puInfo . close ( ) ; } ivPuList . clear ( ) ; } }
|
Close all the active EntityManagers declared in this persistence . xml .
|
37,830
|
JPAPUnitInfo addPU ( String puName , JPAPUnitInfo puInfo ) { synchronized ( ivPuList ) { return ivPuList . put ( puName , puInfo ) ; } }
|
Adds the puInfo to the collection maintained in this xml info object .
|
37,831
|
StringBuilder toStringBuilder ( StringBuilder sbuf ) { synchronized ( ivPuList ) { sbuf . append ( "\n PxmlInfo: ScopeName=" ) . append ( ivScopeInfo . getScopeName ( ) ) . append ( "\tRootURL = " ) . append ( ivRootURL ) . append ( "\t# PUs = " ) . append ( ivPuList . size ( ) ) . append ( "\t[" ) ; int index = 0 ; for ( JPAPUnitInfo puInfo : ivPuList . values ( ) ) { puInfo . toStringBuilder ( sbuf ) ; if ( ++ index < ivPuList . size ( ) ) { sbuf . append ( ", " ) ; } } sbuf . append ( ']' ) ; } return sbuf ; }
|
Dump this persistence . xml data to the input StringBuilder .
|
37,832
|
private static void restoreInvocationSubject ( SubjectCookie cookie ) { try { if ( cookie . token != null ) { ThreadIdentityManager . resetChecked ( cookie . token ) ; } } catch ( ThreadIdentityException e ) { throw new SecurityException ( e ) ; } finally { SubjectManagerService sms = smServiceRef . getService ( ) ; if ( sms != null ) { sms . setInvocationSubject ( cookie . subject ) ; } } }
|
Restore the invocation subject .
|
37,833
|
public RetryState createRetryState ( RetryPolicy policy , MetricRecorder metricRecorder ) { if ( policy == null ) { return new RetryStateNullImpl ( ) ; } else { return new RetryStateImpl ( policy , metricRecorder ) ; } }
|
Create an object implementing Retry
|
37,834
|
public SyncBulkheadState createSyncBulkheadState ( BulkheadPolicy policy , MetricRecorder metricRecorder ) { if ( policy == null ) { return new SyncBulkheadStateNullImpl ( ) ; } else { return new SyncBulkheadStateImpl ( policy , metricRecorder ) ; } }
|
Create an object implementing a synchronous Bulkhead
|
37,835
|
public TimeoutState createTimeoutState ( ScheduledExecutorService executorService , TimeoutPolicy policy , MetricRecorder metricRecorder ) { if ( policy == null ) { return new TimeoutStateNullImpl ( ) ; } else { return new TimeoutStateImpl ( executorService , policy , metricRecorder ) ; } }
|
Create an object implementing Timeout
|
37,836
|
public CircuitBreakerState createCircuitBreakerState ( CircuitBreakerPolicy policy , MetricRecorder metricRecorder ) { if ( policy == null ) { return new CircuitBreakerStateNullImpl ( ) ; } else { return new CircuitBreakerStateImpl ( policy , metricRecorder ) ; } }
|
Create an object implementing CircuitBreaker
|
37,837
|
public Object [ ] getResults ( String topic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getResults" , topic ) ; if ( cachedResults != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getResults" , cachedResults ) ; return cachedResults ; } postProcess ( topic ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getResults" , "finalResults: " + Arrays . toString ( finalResults ) ) ; return finalResults ; }
|
postProcessMatches methods of the handlers .
|
37,838
|
protected String createPlainTextJWT ( ) { com . google . gson . JsonObject header = createHeader ( ) ; com . google . gson . JsonObject payload = createPayload ( ) ; String plainTextTokenString = computeBaseString ( header , payload ) ; StringBuffer sb = new StringBuffer ( plainTextTokenString ) ; sb . append ( "." ) . append ( "" ) ; return sb . toString ( ) ; }
|
Creates the plain text JWT .
|
37,839
|
private ConnectionData findConnectionDataToUse ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findConnectionDataToUse" ) ; ConnectionData connectionDataToUse = null ; synchronized ( connectionData ) { int lowestUseCount = conversationsPerConnection ; for ( int i = 0 ; i < connectionData . size ( ) ; ++ i ) { final ConnectionData cd = connectionData . get ( i ) ; if ( cd . getUseCount ( ) < lowestUseCount ) { lowestUseCount = cd . getUseCount ( ) ; connectionDataToUse = cd ; } } if ( connectionDataToUse == null ) { final IdleConnectionPool p = IdleConnectionPool . getInstance ( ) ; final OutboundConnection oc = p . remove ( groupEndpointDescriptor ) ; if ( oc != null ) { connectionDataToUse = new ConnectionData ( this , groupEndpointDescriptor ) ; oc . setConnectionData ( connectionDataToUse ) ; connectionDataToUse . setConnection ( oc ) ; connectionData . add ( connectionDataToUse ) ; } } if ( connectionDataToUse != null ) { connectionDataToUse . incrementUseCount ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findConnectionDataToUse" , connectionDataToUse ) ; return connectionDataToUse ; }
|
Helper method chooses the connection to use for a new conversation .
|
37,840
|
private Conversation doConnect ( ConversationReceiveListener conversationReceiveListener , ConversationUsageType usageType , JFapAddressHolder jfapAddressHolder , final NetworkConnectionFactoryHolder ncfHolder ) throws JFapConnectFailedException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "doConnect" , new Object [ ] { conversationReceiveListener , usageType , jfapAddressHolder , ncfHolder } ) ; Conversation retConversation ; ConnectionData connectionDataToUse ; synchronized ( connectionMonitor ) { try { connectionDataToUse = findConnectionDataToUse ( ) ; boolean isNewConnectionData = false ; if ( connectionDataToUse == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "connection data does not already exist" ) ; try { NetworkConnection vc = connectOverNetwork ( jfapAddressHolder , ncfHolder ) ; connectionDataToUse = createnewConnectionData ( vc ) ; isNewConnectionData = true ; } catch ( FrameworkException frameworkException ) { FFDCFilter . processException ( frameworkException , "com.ibm.ws.sib.jfapchannel.impl.octracker.ConnectionDataGroup.doConnect" , JFapChannelConstants . CONNDATAGROUP_CONNECT_04 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , frameworkException ) ; throw new SIErrorException ( nls . getFormattedMessage ( "CONNDATAGROUP_INTERNAL_SICJ0062" , null , "CONNDATAGROUP_INTERNAL_SICJ0062" ) , frameworkException ) ; } } retConversation = startNewConversation ( connectionDataToUse , conversationReceiveListener , isNewConnectionData , usageType . requiresNormalHandshakeProcessing ( ) ) ; } finally { synchronized ( this ) { -- connectAttemptsPending ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , connectAttemptsPending + " connection attempts still pending" ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "doConnect" , retConversation ) ; return retConversation ; }
|
Actually do the connecting creating a new ConnectionData if required
|
37,841
|
private NetworkConnection connectOverNetwork ( JFapAddressHolder addressHolder , NetworkConnectionFactoryHolder factoryHolder ) throws JFapConnectFailedException , FrameworkException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "connectOverNetwork" , new Object [ ] { addressHolder , factoryHolder } ) ; NetworkConnectionFactory vcf = factoryHolder . getFactory ( ) ; NetworkConnection vc = vcf . createConnection ( ) ; Semaphore sem = new Semaphore ( ) ; ClientConnectionReadyCallback callback = new ClientConnectionReadyCallback ( sem ) ; vc . connectAsynch ( addressHolder . getAddress ( ) , callback ) ; sem . waitOnIgnoringInterruptions ( ) ; if ( ! callback . connectionSucceeded ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Connect has failed due to " , callback . getException ( ) ) ; String failureKey ; Object [ ] failureInserts ; if ( addressHolder . getAddress ( ) != null ) { failureKey = "CONNDATAGROUP_CONNFAILED_SICJ0063" ; failureInserts = addressHolder . getErrorInserts ( ) ; } else { failureKey = "CONNDATAGROUP_CONNFAILED_SICJ0080" ; failureInserts = new Object [ ] { } ; } String message = nls . getFormattedMessage ( failureKey , failureInserts , failureKey ) ; throw new JFapConnectFailedException ( message , callback . getException ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "connectOverNetwork" , vc ) ; return vc ; }
|
Create a new connection over the network
|
37,842
|
private ConnectionData createnewConnectionData ( NetworkConnection vc ) throws FrameworkException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createnewConnectionData" , vc ) ; ConnectionData connectionDataToUse ; NetworkConnectionContext connLink = vc . getNetworkConnectionContext ( ) ; connectionDataToUse = new ConnectionData ( this , groupEndpointDescriptor ) ; connectionDataToUse . incrementUseCount ( ) ; OutboundConnection oc = new OutboundConnection ( connLink , vc , tracker , heartbeatInterval , heartbeatTimeout , connectionDataToUse ) ; connectionDataToUse . setConnection ( oc ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createnewConnectionData" , connectionDataToUse ) ; return connectionDataToUse ; }
|
Create a new Connection data object
|
37,843
|
private Conversation startNewConversation ( ConnectionData connectionDataToUse , ConversationReceiveListener conversationReceiveListener , boolean isNewConnectionData , boolean handshake ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "startNewConversation" , new Object [ ] { connectionDataToUse , conversationReceiveListener , Boolean . valueOf ( isNewConnectionData ) , Boolean . valueOf ( handshake ) } ) ; Conversation retConversation ; synchronized ( this ) { if ( isNewConnectionData ) { synchronized ( connectionData ) { connectionData . add ( connectionDataToUse ) ; } } retConversation = connectionDataToUse . getConnection ( ) . startNewConversation ( conversationReceiveListener , handshake ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "startNewConversation" , retConversation ) ; return retConversation ; }
|
start a new conversation using the specified ConnectionData object
|
37,844
|
protected synchronized void connectionPending ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "connectionPending" ) ; ++ connectAttemptsPending ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , connectAttemptsPending + " connection attempts now pending" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "connectionPending" ) ; }
|
Marks the group as having been selected to establish a new conversation . This is used to close a window where the group can be selected but then get closed before the connect call is made .
|
37,845
|
protected synchronized void close ( OutboundConnection connection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , connection ) ; if ( connection . getConnectionData ( ) . getConnectionDataGroup ( ) != this ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "connection does not belong to this group" , connection . getConnectionData ( ) . getConnectionDataGroup ( ) ) ; throw new SIErrorException ( nls . getFormattedMessage ( "CONNDATAGROUP_INTERNAL_SICJ0062" , null , "CONNDATAGROUP_INTERNAL_SICJ0062" ) ) ; } ConnectionData data ; boolean isNowIdle = false ; synchronized ( connectionData ) { data = connection . getConnectionData ( ) ; data . decrementUseCount ( ) ; if ( data . getUseCount ( ) == 0 ) { connectionData . remove ( data ) ; isNowIdle = true ; } } if ( isNowIdle ) { IdleConnectionPool . getInstance ( ) . add ( data . getConnection ( ) , groupEndpointDescriptor ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
|
Close a conversation on the specified connection . The connection must be part of this group . If the connection has no more conversations left using it then it is added to the idle pool .
|
37,846
|
protected boolean isEmpty ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isEmpty" ) ; boolean result ; synchronized ( this ) { synchronized ( connectionData ) { result = connectionData . isEmpty ( ) ; } result = result && ( connectAttemptsPending == 0 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isEmpty" , "" + result ) ; return result ; }
|
Determines if this group is empty . For the group to be empty it must contain no connection data objects and have no connection attempts pending . This second criteria stops the group from being discarded between selection for establishing a new conversation and actually establishing the conversation .
|
37,847
|
protected void purgeFromInvalidateImpl ( OutboundConnection connection , boolean notifyPeer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "purgeFromInvalidateImpl" , new Object [ ] { connection , Boolean . valueOf ( notifyPeer ) } ) ; purge ( connection , true , notifyPeer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "purgeFromInvalidateImpl" ) ; }
|
Purge a connection from this group from within invalidate processing . Purging a connection removes it from the group even if the connection still has conversations associated with it . The purged connection is closed and not added to the idle pool .
|
37,848
|
protected void purgeClosedConnection ( OutboundConnection connection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "purgeClosedConnection" , connection ) ; purge ( connection , false , false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "purgeClosedConnection" ) ; }
|
Purge a connection from this group because it has already been closed . The purged connection is not added to the idle pool .
|
37,849
|
public void removeConnectionDataFromGroup ( ConnectionData cd ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeConnectionDataFromGroup" , new Object [ ] { cd } ) ; boolean removed = false ; synchronized ( connectionData ) { removed = connectionData . remove ( cd ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeConnectionDataFromGroup" , new Object [ ] { removed } ) ; }
|
Remove the connection from the group
|
37,850
|
public static String getDateString ( Date date ) { SimpleDateFormat sdf = new SimpleDateFormat ( sdformatMillisec ) ; sdf . setTimeZone ( TimeZone . getTimeZone ( "GMT" ) ) ; StringBuffer dateBuffer = new StringBuffer ( sdf . format ( date ) ) ; dateBuffer . insert ( dateBuffer . length ( ) - 2 , ":" ) ; return dateBuffer . toString ( ) ; }
|
Returns a date String from the specified Date object . It is expected to be called before passing the date to SDO set method .
|
37,851
|
public static String [ ] getRDNAttributes ( String dn ) { String rdnstr = getRDN ( dn ) ; StringTokenizer st = new StringTokenizer ( rdnstr . toLowerCase ( ) , "+" ) ; List < String > list = new ArrayList < String > ( ) ; while ( st . hasMoreTokens ( ) ) { String rdn = st . nextToken ( ) ; int index = rdn . indexOf ( '=' ) ; if ( index > - 1 ) { list . add ( rdn . substring ( 0 , index ) ) ; } } return list . toArray ( new String [ 0 ] ) ; }
|
Return an array of RDN attributes of the given DN in lower case form .
|
37,852
|
public static String getRDN ( String DN ) { if ( DN == null || DN . trim ( ) . length ( ) == 0 ) { return DN ; } String RDN = null ; try { LdapName name = new LdapName ( DN ) ; if ( name . size ( ) == 0 ) { return DN ; } RDN = name . get ( name . size ( ) - 1 ) ; } catch ( InvalidNameException e ) { e . getMessage ( ) ; DN = DN . trim ( ) ; int pos1 = DN . indexOf ( ',' ) ; if ( DN . charAt ( pos1 - 1 ) == '\\' ) { pos1 = DN . indexOf ( pos1 , ',' ) ; } if ( pos1 > - 1 ) { RDN = DN . substring ( 0 , pos1 ) . trim ( ) ; } else { RDN = DN ; } } return RDN ; }
|
Gets the RDN from the specified DN For example uid = persona will be returned for given uid = persona cn = users dc = yourco dc = com .
|
37,853
|
static public LdapURL [ ] getLdapURLs ( Attribute attr ) throws WIMException { final String METHODNAME = "getLdapURLs" ; LdapURL [ ] ldapURLs = new LdapURL [ 0 ] ; if ( attr != null ) { List < LdapURL > ldapURLList = new ArrayList < LdapURL > ( attr . size ( ) ) ; try { for ( NamingEnumeration < ? > enu = attr . getAll ( ) ; enu . hasMoreElements ( ) ; ) { LdapURL ldapURL = new LdapURL ( ( String ) ( enu . nextElement ( ) ) ) ; if ( ldapURL . parsedOK ( ) ) { ldapURLList . add ( ldapURL ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Member URL query: " + ldapURL . get_url ( ) + " is invalid and ingored." ) ; } } } } catch ( NamingException e ) { throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ) ; } ldapURLs = ldapURLList . toArray ( ldapURLs ) ; } return ldapURLs ; }
|
Gets the LdapURL array from the given dynamic member attribute .
|
37,854
|
public static String getUniqueKey ( X509Certificate cert ) { StringBuffer key = new StringBuffer ( "subjectDN:" ) ; key . append ( cert . getSubjectX500Principal ( ) . getName ( ) ) . append ( "issuerDN:" ) . append ( cert . getIssuerX500Principal ( ) . getName ( ) ) ; return null ; }
|
Get a unique key for a certificate .
|
37,855
|
static String getDNSubField ( String varName , String DN ) throws CertificateMapperException { if ( varName . equals ( "DN" ) ) { return DN ; } StringTokenizer st = new StringTokenizer ( DN ) ; for ( ; ; ) { String name , value ; try { name = st . nextToken ( ",= " ) ; value = st . nextToken ( "," ) ; if ( value != null ) { value = value . substring ( 1 ) ; } } catch ( NoSuchElementException e ) { e . getMessage ( ) ; break ; } if ( name . equals ( varName ) ) { return value ; } } throw new CertificateMapperException ( WIMMessageKey . UNKNOWN_DN_FIELD , Tr . formatMessage ( tc , WIMMessageKey . UNKNOWN_DN_FIELD , WIMMessageHelper . generateMsgParms ( varName ) ) ) ; }
|
Given input return the digest version .
|
37,856
|
public static short getMembershipScope ( String scope ) { if ( scope != null ) { scope = scope . trim ( ) ; if ( LdapConstants . LDAP_DIRECT_GROUP_MEMBERSHIP_STRING . equalsIgnoreCase ( scope ) ) { return LdapConstants . LDAP_DIRECT_GROUP_MEMBERSHIP ; } else if ( LdapConstants . LDAP_NESTED_GROUP_MEMBERSHIP_STRING . equalsIgnoreCase ( scope ) ) { return LdapConstants . LDAP_NESTED_GROUP_MEMBERSHIP ; } else if ( LdapConstants . LDAP_ALL_GROUP_MEMBERSHIP_STRING . equalsIgnoreCase ( scope ) ) { return LdapConstants . LDAP_ALL_GROUP_MEMBERSHIP ; } else { return LdapConstants . LDAP_DIRECT_GROUP_MEMBERSHIP ; } } else { return LdapConstants . LDAP_DIRECT_GROUP_MEMBERSHIP ; } }
|
Gets the short form the scope from the string form of the scope
|
37,857
|
public static boolean inAttributes ( String attrName , Attributes attrs ) { for ( NamingEnumeration < String > neu = attrs . getIDs ( ) ; neu . hasMoreElements ( ) ; ) { String attrId = neu . nextElement ( ) ; if ( attrId . equalsIgnoreCase ( attrName ) ) { return true ; } } return false ; }
|
Whether the specified attribute name is contained in the attributes .
|
37,858
|
public static Attribute cloneAttribute ( String newAttrName , Attribute attr ) throws WIMSystemException { Attribute newAttr = new BasicAttribute ( newAttrName ) ; try { for ( NamingEnumeration < ? > neu = attr . getAll ( ) ; neu . hasMoreElements ( ) ; ) { newAttr . add ( neu . nextElement ( ) ) ; } } catch ( NamingException e ) { throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ) ; } return newAttr ; }
|
Clone the specified attribute with a new name .
|
37,859
|
public static String convertToDashedString ( byte [ ] objectGUID ) { StringBuilder displayStr = new StringBuilder ( ) ; displayStr . append ( prefixZeros ( objectGUID [ 3 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 2 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 1 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 0 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 5 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 4 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 7 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 6 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 8 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 9 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 10 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 11 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 12 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 13 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 14 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 15 ] & 0xFF ) ) ; return displayStr . toString ( ) ; }
|
Convert the byte array to Active Directory GUID format .
|
37,860
|
public static JsonValue serializeAsJson ( Object o ) throws IOException { try { return findFieldsToSerialize ( o ) . mainObject ; } catch ( IllegalStateException ise ) { throw new IOException ( "Unable to build JSON for Object" , ise ) ; } catch ( JsonException e ) { throw new IOException ( "Unable to build JSON for Object" , e ) ; } }
|
Convert a POJO into a serialized JsonValue object
|
37,861
|
private static ClassAndMethod getClassForFieldName ( String fieldName , Class < ? > classToLookForFieldIn ) { return internalGetClassForFieldName ( fieldName , classToLookForFieldIn , false ) ; }
|
Gets a class for a JSON field name by looking in a given Class for an appropriate setter . The setter is assumed not to be a Collection .
|
37,862
|
private static ClassAndMethod getClassForCollectionOfFieldName ( String fieldName , Class < ? > classToLookForFieldIn ) { return internalGetClassForFieldName ( fieldName , classToLookForFieldIn , true ) ; }
|
Gets a class for a JSON field name by looking in a given Class for an appropriate setter . The setter is assumed to be a Collection .
|
37,863
|
private static ClassAndMethod internalGetClassForFieldName ( String fieldName , Class < ? > classToLookForFieldIn , boolean isForArray ) { Method found = null ; String fieldNameAsASetter = new StringBuilder ( "set" ) . append ( fieldName . substring ( 0 , 1 ) . toUpperCase ( ) ) . append ( fieldName . substring ( 1 ) ) . toString ( ) ; for ( Method m : classToLookForFieldIn . getMethods ( ) ) { String methodName = m . getName ( ) ; if ( m . getParameterTypes ( ) . length == 1 && methodName . equals ( fieldNameAsASetter ) ) { found = m ; break ; } } if ( found == null ) { if ( DataModelSerializer . IGNORE_UNKNOWN_FIELDS ) { return null ; } else { throw new IllegalStateException ( "Data Model Error: Found unexpected JSON field " + fieldName + " supposedly for in class " + classToLookForFieldIn . getName ( ) ) ; } } else { ClassAndMethod cm = new ClassAndMethod ( ) ; cm . m = found ; if ( isForArray ) { Type t = found . getGenericParameterTypes ( ) [ 0 ] ; cm . cls = getClassForType ( t ) ; return cm ; } else { cm . cls = found . getParameterTypes ( ) [ 0 ] ; return cm ; } } }
|
Utility method given a JSON field name and an associated POJO it will hunt for the appropriate setter to use and if located return the type the setter expects along with a reflected reference to the method itself .
|
37,864
|
public static void addThreadIdentityService ( ThreadIdentityService tis ) { if ( tis != null ) { threadIdentityServices . add ( tis ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "A ThreadIdentityService implementation was added." , tis . getClass ( ) . getName ( ) ) ; } } }
|
Add a ThreadIdentityService reference . This method is called by ThreadIdentityManagerConfigurator when a ThreadIdentityService shows up in the OSGI framework .
|
37,865
|
public static void addJ2CIdentityService ( J2CIdentityService j2cIdentityService ) { if ( j2cIdentityService != null ) { j2cIdentityServices . add ( j2cIdentityService ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "A J2CIdentityService implementation was added." , j2cIdentityService . getClass ( ) . getName ( ) ) ; } } }
|
Add a J2CIdentityService reference . This method is called by ThreadIdentityManagerConfigurator when a J2CIdentityService shows up in the OSGI framework .
|
37,866
|
public static void removeThreadIdentityService ( ThreadIdentityService tis ) { if ( tis != null ) { threadIdentityServices . remove ( tis ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "A ThreadIdentityService implementation was removed." , tis . getClass ( ) . getName ( ) ) ; } } }
|
Remove a ThreadIdentityService reference . This method is called by ThreadIdentityManagerConfigurator when a ThreadIdentityService leaves the OSGI framework .
|
37,867
|
public static void removeJ2CIdentityService ( J2CIdentityService j2cIdentityService ) { if ( j2cIdentityService != null ) { j2cIdentityServices . remove ( j2cIdentityService ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "A J2CIdentityService implementation was removed." , j2cIdentityService . getClass ( ) . getName ( ) ) ; } } }
|
Remove a J2CIdentityService reference . This method is called by ThreadIdentityManagerConfigurator when a J2CIdentityService leaves the OSGI framework .
|
37,868
|
public static void removeAllThreadIdentityServices ( ) { threadIdentityServices . clear ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "All the ThreadIdentityService implementations were removed." ) ; } }
|
Remove all the ThreadIdentityService references . This method is called by ThreadIdentityManagerConfigurator when the ThreadIdentityService service tracker is closed .
|
37,869
|
public static void removeAllJ2CIdentityServices ( ) { j2cIdentityServices . clear ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "All the J2CIdentityService implementations were removed." ) ; } }
|
Remove all the J2CIdentityService references . This method is called by ThreadIdentityManagerConfigurator when the J2CIdentityService service tracker is closed .
|
37,870
|
private static boolean checkForRecursionAndSet ( ) { if ( recursionMarker . get ( ) == null ) { recursionMarker . set ( Boolean . TRUE ) ; return false ; } else { return true ; } }
|
Check for recursion .
|
37,871
|
public static Object runAsServer ( ) { LinkedHashMap < ThreadIdentityService , Object > token = null ; if ( ! checkForRecursionAndSet ( ) ) { try { for ( int i = 0 , size = threadIdentityServices . size ( ) ; i < size ; ++ i ) { ThreadIdentityService tis = threadIdentityServices . get ( i ) ; if ( tis . isAppThreadIdentityEnabled ( ) ) { if ( token == null ) { token = new LinkedHashMap < ThreadIdentityService , Object > ( ) ; } token . put ( tis , tis . runAsServer ( ) ) ; } } } finally { resetRecursionCheck ( ) ; } } return token == null ? Collections . EMPTY_MAP : token ; }
|
Set the server s identity as the thread identity .
|
37,872
|
@ SuppressWarnings ( { "rawtypes" } ) private static void resetCheckedInternal ( Object token , Exception firstException ) throws ThreadIdentityException { Exception cachedException = firstException ; if ( threadIdentityServices . isEmpty ( ) == false || j2cIdentityServices . isEmpty ( ) == false ) { if ( ! checkForRecursionAndSet ( ) ) { try { if ( token != null ) { Map tokenMap = ( Map ) token ; int size = tokenMap . size ( ) ; if ( size > 0 ) { @ SuppressWarnings ( "unchecked" ) List < Map . Entry > identityServicesToTokensMap = new ArrayList < Map . Entry > ( tokenMap . entrySet ( ) ) ; for ( int idx = size - 1 ; idx >= 0 ; idx -- ) { Map . Entry entry = identityServicesToTokensMap . get ( idx ) ; Object identityService = entry . getKey ( ) ; Object identityServiceToken = entry . getValue ( ) ; try { if ( identityService instanceof ThreadIdentityService ) { ( ( ThreadIdentityService ) identityService ) . reset ( identityServiceToken ) ; } else if ( identityService instanceof J2CIdentityService ) { ( ( J2CIdentityService ) identityService ) . reset ( identityServiceToken ) ; } } catch ( Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , thisClass , "385" ) ; if ( cachedException == null ) { cachedException = e ; } } } } } } finally { resetRecursionCheck ( ) ; if ( cachedException != null ) { throw new ThreadIdentityException ( cachedException ) ; } } } } }
|
Reset the identity on the thread .
|
37,873
|
public static Subject getJ2CInvocationSubject ( ) { Subject j2cSubject = null ; for ( J2CIdentityService j2cIdentityService : j2cIdentityServices ) { if ( j2cIdentityService . isJ2CThreadIdentityEnabled ( ) ) { Subject subject = j2cIdentityService . getJ2CInvocationSubject ( ) ; if ( subject != null ) { j2cSubject = subject ; break ; } } } return j2cSubject ; }
|
Get a J2C subject based on the invocation subject . Use first subject that is not null .
|
37,874
|
public Map < String , List < AppConfigurationEntry > > getEntries ( ) { Map < String , List < AppConfigurationEntry > > jaasConfigurationEntries = new HashMap < String , List < AppConfigurationEntry > > ( ) ; Map < String , String > jaasConfigIDs = new HashMap < String , String > ( ) ; if ( jaasLoginContextEntries != null ) { createJAASClientLoginContextEntry ( jaasConfigurationEntries ) ; Iterator < JAASLoginContextEntry > lcEntries = jaasLoginContextEntries . getServices ( ) ; while ( lcEntries . hasNext ( ) ) { JAASLoginContextEntry loginContextEntry = lcEntries . next ( ) ; String entryName = loginContextEntry . getEntryName ( ) ; List < JAASLoginModuleConfig > loginModules = loginContextEntry . getLoginModules ( ) ; if ( JaasLoginConfigConstants . SYSTEM_DEFAULT . equalsIgnoreCase ( entryName ) ) { ensureProxyIsNotSpecifyInSystemDefaultEntry ( entryName , loginModules ) ; } List < AppConfigurationEntry > appConfEntry = getLoginModules ( loginModules ) ; if ( appConfEntry != null && ! appConfEntry . isEmpty ( ) ) { if ( jaasConfigIDs . containsKey ( entryName ) ) { String id = jaasConfigIDs . get ( entryName ) ; Tr . warning ( tc , "JAAS_LOGIN_CONTEXT_ENTRY_HAS_DUPLICATE_NAME" , new Object [ ] { entryName , id , loginContextEntry . getId ( ) } ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "configure jaasContextLoginEntry id: " + loginContextEntry . getId ( ) ) ; Tr . debug ( tc , "configure jaasContextLoginEntry: " + entryName + " has " + appConfEntry . size ( ) + " loginModule(s)" ) ; Tr . debug ( tc , "appConfEntry: " + appConfEntry ) ; } jaasConfigurationEntries . put ( entryName , appConfEntry ) ; jaasConfigIDs . put ( entryName , loginContextEntry . getId ( ) ) ; } } } return jaasConfigurationEntries ; }
|
Get all jaasLoginContextEntry in the server . xml and create any missing default entries . If there are no jaas configuration then create all the default entries system . DEFAULT system . WEB_INBOUND system . DESERIALIZE_CONTEXT system . UNAUTHENTICATED and WSLogin
|
37,875
|
public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { if ( "addTransformer" . equals ( method . getName ( ) ) ) { addTransformer ( ( ClassFileTransformer ) args [ 0 ] , args . length > 1 ? ( Boolean ) args [ 1 ] : false ) ; return null ; } if ( "removeTransformer" . equals ( method . getName ( ) ) ) { return removeTransformer ( ( ClassFileTransformer ) args [ 0 ] ) ; } if ( "appendToBootstrapClassLoaderSearch" . equals ( method . getName ( ) ) ) { appendToBootstrapClassLoaderSearch ( ( JarFile ) args [ 0 ] ) ; return null ; } if ( "appendToSystemClassLoaderSearch" . equals ( method . getName ( ) ) ) { appendToSystemClassLoaderSearch ( ( JarFile ) args [ 0 ] ) ; return null ; } if ( "setNativeMethodPrefix" . equals ( method . getName ( ) ) ) { setNativeMethodPrefix ( ( ClassFileTransformer ) args [ 0 ] , ( String ) args [ 1 ] ) ; return null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , method . getName ( ) , args ) ; } Object retValue = method . invoke ( instrumentation , args ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { if ( void . class == method . getReturnType ( ) ) { Tr . exit ( tc , method . getName ( ) ) ; } else { Tr . exit ( tc , method . getName ( ) , retValue ) ; } } return retValue ; }
|
If this method is traced it can call proxy . toString which causes another invoke call leading to an infinite loop .
|
37,876
|
public static void addSubjectCustomData ( Subject callSubject , Hashtable < String , Object > newCred ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "addSubjectCustomData" , newCred ) ; } AddPrivateCredentials action = new AddPrivateCredentials ( callSubject , newCred ) ; AccessController . doPrivileged ( action ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addSubjectCustomData" ) ; } }
|
This method adds the custom Hashtable provided to the private credentials of the Subject passed in .
|
37,877
|
public static Hashtable < String , Object > getCustomCredentials ( Subject callSubject , String cacheKey ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getCustomCredentials" , cacheKey ) ; } if ( callSubject == null || cacheKey == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getCustomCredentials" , " null" ) ; } return null ; } GetCustomCredentials action = new GetCustomCredentials ( callSubject , cacheKey ) ; Hashtable < String , Object > cred = ( Hashtable < String , Object > ) AccessController . doPrivileged ( action ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getCustomCredentials" , objectId ( cred ) ) ; } return cred ; }
|
This method extracts the custom hashtable from the provided Subject using the cacheKey .
|
37,878
|
public static void handlePasswordValidationCallback ( PasswordValidationCallback callback , Subject executionSubject , Hashtable < String , Object > addedCred , String appRealm , Invocation [ ] invocations ) throws RemoteException , WSSecurityException { invocations [ 2 ] = Invocation . PASSWORDVALIDATIONCALLBACK ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "handlePasswordValidationCallback" , new Object [ ] { objectId ( callback ) , callback . getUsername ( ) } ) ; } Subject callSubject = callback . getSubject ( ) ; if ( ! executionSubject . equals ( callSubject ) ) { Tr . warning ( tc , "EXECUTION_CALLBACK_SUBJECT_MISMATCH_J2CA0673" , new Object [ ] { "PasswordValidationCallback" } ) ; callSubject = executionSubject ; } try { String userName = callback . getUsername ( ) ; String password = null ; if ( callback . getPassword ( ) != null ) { password = new String ( callback . getPassword ( ) ) ; } if ( callSubject != null ) { GetRegistry action = new GetRegistry ( appRealm ) ; UserRegistry registry = AccessController . doPrivileged ( action ) ; if ( checkUserPassword ( userName , password , registry , appRealm , addedCred , invocations [ 0 ] ) ) { callback . setResult ( true ) ; } else { callback . setResult ( false ) ; addedCred . clear ( ) ; } } } catch ( PrivilegedActionException pae ) { callback . setResult ( false ) ; addedCred . clear ( ) ; Exception ex = pae . getException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "handlePasswordValidationCallback" , callback . getResult ( ) ) ; } if ( ex instanceof WSSecurityException ) { throw ( WSSecurityException ) ex ; } else { throw new WSSecurityException ( ex ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "handlePasswordValidationCallback" , callback . getResult ( ) ) ; } }
|
The PasswordValidationCallback is used for password validation . This callback is used by the Resource Adapter to employ the password validation facilities of its containing runtime . This Callback is passed to the CallbackHandler provided by the J2C runtime during invocation of the handle method by the Resource Adapter .
|
37,879
|
private static void addUniqueIdAndGroupsForUser ( String securityName , Hashtable < String , Object > credData , String appRealm ) throws WSSecurityException , RemoteException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "addUniqueIdAndGroupsForUser" , securityName ) ; } GetRegistry action = new GetRegistry ( appRealm ) ; UserRegistry registry = null ; try { registry = AccessController . doPrivileged ( action ) ; } catch ( PrivilegedActionException pae ) { Exception ex = pae . getException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addUniqueIdAndGroupsForUser" ) ; } if ( ex instanceof WSSecurityException ) { throw ( WSSecurityException ) ex ; } else { throw new WSSecurityException ( ex ) ; } } if ( registry . isValidUser ( securityName ) ) { String uniqueId = registry . getUniqueUserId ( securityName ) ; String uidGrp = stripRealm ( uniqueId , appRealm ) ; List < ? > groups = null ; try { groups = registry . getUniqueGroupIds ( uidGrp ) ; } catch ( EntryNotFoundException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception is " , ex ) ; Tr . warning ( tc , "NO_GROUPS_FOR_UNIQUEID_J2CA0679" , uidGrp ) ; } updateCustomHashtable ( credData , appRealm , uniqueId , securityName , groups ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Added uniqueId: " + uniqueId + " and uniqueGroups: " + groups ) ; } else { String message = getNLS ( ) . getFormattedMessage ( "INVALID_USER_NAME_IN_PRINCIPAL_J2CA0670" , new Object [ ] { securityName } , "J2CA0670E: The WorkManager was unable to establish the security context for the Work instance, " + "because the resource adapter provided a caller identity " + securityName + ", which does not belong to the security " + "domain associated with the application." ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addUniqueIdAndGroupsForUser" ) ; } throw new WSSecurityException ( message ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addUniqueIdAndGroupsForUser" ) ; } }
|
Checks if the provided securityName is valid against the user registry . In case it is valid it then gets uniqueId and the groups for the user with the given securityName . It then uses this information to create the custom hashtable required for login .
|
37,880
|
private static boolean checkUserPassword ( String userSecurityName , String password , UserRegistry registry , String realmName , Hashtable < String , Object > addedCred , Invocation isCCInvoked ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "checkUserPassword user: " + userSecurityName + ", realm: " + realmName ) ; } if ( userSecurityName == null || password == null ) { Tr . error ( tc , "INVALID_USERNAME_PASSWORD_INBOUND_J2CA0674" , userSecurityName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , new Object [ ] { userSecurityName , password } ) ; } return false ; } boolean match = validateCallbackInformation ( addedCred , userSecurityName , isCCInvoked ) ; if ( ! match ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - invalid username and password." ) ; } return false ; } try { registry . checkPassword ( userSecurityName , password ) ; String uniqueId = registry . getUniqueUserId ( userSecurityName ) ; uniqueId = stripRealm ( uniqueId , realmName ) ; List < String > uniqueGroups = new ArrayList < String > ( ) ; List < ? > groupNames = registry . getGroupsForUser ( userSecurityName ) ; if ( groupNames != null ) for ( Object group : groupNames ) { uniqueGroups . add ( registry . getUniqueGroupId ( ( String ) group ) ) ; } updateCustomHashtable ( addedCred , realmName , uniqueId , userSecurityName , uniqueGroups ) ; } catch ( PasswordCheckFailedException e ) { Tr . error ( tc , "INVALID_USERNAME_PASSWORD_INBOUND_J2CA0674" , userSecurityName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - invalid username and password" ) ; } return false ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ejs.j2c.work.security.J2CSecurityHelper.checkUserPassword" , "%C" ) ; Tr . error ( tc , "VALIDATION_FAILED_INBOUND_J2CA0684" , userSecurityName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - unable to validate password." ) ; } return false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - password is valid." ) ; } return true ; }
|
Checks the user name and password against the user registry provided . If the user name and password are valid it returns true .
|
37,881
|
public static String getCacheKey ( String uniqueId , String appRealm ) { StringBuilder cacheKey = new StringBuilder ( ) ; if ( uniqueId == null || appRealm == null ) { cacheKey . append ( CACHE_KEY_PREFIX ) ; } else { cacheKey . append ( CACHE_KEY_PREFIX ) . append ( uniqueId ) . append ( CACHE_KEY_SEPARATOR ) . append ( appRealm ) ; } return cacheKey . toString ( ) ; }
|
This method constructs the cache key that is required by security for caching the Subject .
|
37,882
|
private static boolean validateCallbackInformation ( Hashtable < String , Object > credData , String securityName , Invocation isInvoked ) { boolean status = true ; if ( isInvoked == Invocation . CALLERPRINCIPALCALLBACK ) { String existingName = ( String ) credData . get ( AttributeNameConstants . WSCREDENTIAL_SECURITYNAME ) ; if ( existingName != null && ! ( existingName . equals ( securityName ) ) ) { status = false ; Tr . error ( tc , "CALLBACK_SECURITY_NAME_MISMATCH_J2CA0675" , new Object [ ] { securityName , existingName } ) ; } } return status ; }
|
This method validates whether the user security name provided by the CallerPrincipalCallback and the PasswordValidationCallback match . It does this check only in case the CallerPrincipalCallback was invoked prior to the current invocation of the PasswordValidationCallback .
|
37,883
|
public static String objectId ( Object o ) { return ( o == null ) ? "0x0" : o . getClass ( ) . getName ( ) + "@" + Integer . toHexString ( o . hashCode ( ) ) ; }
|
A string that identifies an object instance within WAS messages and heap dumps .
|
37,884
|
synchronized void activate ( ComponentContext componentContext ) throws Exception { this . componentContext = componentContext ; this . classAvailableTransformer = new ClassAvailableTransformer ( this , instrumentation , includeBootstrap ) ; this . transformer = new ProbeClassFileTransformer ( this , instrumentation , includeBootstrap ) ; this . proxyActivator = new MonitoringProxyActivator ( componentContext . getBundleContext ( ) , this , this . instrumentation ) ; this . proxyActivator . activate ( ) ; for ( Class < ? > clazz : MonitoringUtility . loadMonitoringClasses ( componentContext . getBundleContext ( ) . getBundle ( ) ) ) { for ( int i = 0 ; i < clazz . getMethods ( ) . length ; i ++ ) { Annotation anno = ( ( clazz . getMethods ( ) [ i ] ) . getAnnotation ( ProbeSite . class ) ) ; if ( anno != null ) { String temp = ( ( ProbeSite ) anno ) . clazz ( ) ; probeMonitorSet . add ( temp ) ; } } } this . instrumentation . addTransformer ( this . transformer , true ) ; this . instrumentation . addTransformer ( this . classAvailableTransformer ) ; for ( Class < ? > clazz : this . instrumentation . getAllLoadedClasses ( ) ) { classAvailable ( clazz ) ; } }
|
Activation callback from the Declarative Services runtime where the component is ready for activation .
|
37,885
|
synchronized void deactivate ( ) throws Exception { this . proxyActivator . deactivate ( ) ; this . instrumentation . removeTransformer ( this . classAvailableTransformer ) ; this . instrumentation . removeTransformer ( this . transformer ) ; this . shuttingDown = true ; Collection < Class < ? > > probedClasses = processRemovedListeners ( allRegisteredListeners ) ; listenersLock . writeLock ( ) . lock ( ) ; try { listenersForMonitor . clear ( ) ; allRegisteredListeners . clear ( ) ; } finally { listenersLock . writeLock ( ) . unlock ( ) ; } activeProbesById . clear ( ) ; listenersByProbe . clear ( ) ; listenersByClass . clear ( ) ; probesByKey . clear ( ) ; probesByListener . clear ( ) ; this . proxyActivator = null ; this . transformer = null ; this . componentContext = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "deactivate: probedClasses.size() = " + probedClasses . size ( ) ) ; } for ( Class < ? > clazz : probedClasses ) { instrumentation . retransformClasses ( clazz ) ; } this . instrumentation = null ; }
|
Deactivation callback from the Declarative Services runtime where the component is deactivated .
|
37,886
|
public boolean registerMonitor ( Object monitor ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "monitor = " + monitor ) ; } long startTime = System . nanoTime ( ) ; Set < ProbeListener > listeners = buildListenersFromAnnotated ( monitor ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "buildListenersFromAnnotated time = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } startTime = System . nanoTime ( ) ; if ( ! addListenersForMonitor ( monitor , listeners ) ) { return false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "addListenersForMonitorTime = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } startTime = System . nanoTime ( ) ; Collection < Class < ? > > effectedClasses = processNewListeners ( listeners ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "processNewListeners time = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "effectedClasses.size() = " + effectedClasses . size ( ) ) ; } startTime = System . nanoTime ( ) ; this . transformer . instrumentWithProbes ( effectedClasses ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "instrumentWithProbes time = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } return true ; }
|
Register an annotated object as a monitor . The annotations will be used to generate the appropriate configuration .
|
37,887
|
public boolean unregisterMonitor ( Object annotatedObject ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "unregisteringMonitor = " + annotatedObject ) ; } Set < ProbeListener > listeners = removeListenersForMonitor ( annotatedObject ) ; if ( listeners == null ) { return false ; } Collection < Class < ? > > effectedClasses = processRemovedListeners ( listeners ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "effectedClasses.size() = " + effectedClasses . size ( ) ) ; } this . transformer . instrumentWithProbes ( effectedClasses ) ; Set set = moduleInstanceToBundleMap . entrySet ( ) ; Iterator i = set . iterator ( ) ; while ( i . hasNext ( ) ) { Map . Entry mapE = ( Map . Entry ) i . next ( ) ; if ( mapE != null && mapE . getValue ( ) . equals ( annotatedObject . getClass ( ) . getName ( ) ) ) { PmiAbstractModule s = ( PmiAbstractModule ) mapE . getKey ( ) ; s . unregister ( ) ; } } return true ; }
|
Unregister the specified monitor . Unregistering a monitor may cause one or more probes to be deactivated and the associated classes retransformed .
|
37,888
|
Set < ProbeListener > removeListenersForMonitor ( Object monitor ) { Set < ProbeListener > listeners = null ; listenersLock . writeLock ( ) . lock ( ) ; try { listeners = listenersForMonitor . remove ( monitor ) ; if ( listeners == null ) { listeners = Collections . emptySet ( ) ; } else { allRegisteredListeners . removeAll ( listeners ) ; } } finally { listenersLock . writeLock ( ) . unlock ( ) ; } return listeners ; }
|
Remove the listeners associated with the specified monitor from the set of registered listeners .
|
37,889
|
Collection < Class < ? > > processNewListeners ( Collection < ProbeListener > listeners ) { Set < Class < ? > > classesToTransform = new HashSet < Class < ? > > ( ) ; Set < ProbeListener > matchingListeners = new HashSet < ProbeListener > ( ) ; Set < Class < ? > > monitorableTemp ; synchronized ( this . monitorable ) { monitorableTemp = new HashSet < Class < ? > > ( this . monitorable ) ; } for ( Class < ? > clazz : monitorableTemp ) { if ( ! isMonitorable ( clazz ) ) { continue ; } for ( ProbeListener listener : listeners ) { ProbeFilter filter = listener . getProbeFilter ( ) ; if ( filter . matches ( clazz ) ) { matchingListeners . add ( listener ) ; } } if ( ! matchingListeners . isEmpty ( ) ) { classesToTransform . add ( clazz ) ; addInterestedByClass ( clazz , matchingListeners ) ; } matchingListeners . clear ( ) ; } return classesToTransform ; }
|
Process recently registered listeners and calculate which classes need to be transformed with probes that drive the listeners .
|
37,890
|
synchronized Collection < Class < ? > > processRemovedListeners ( Collection < ProbeListener > listeners ) { Set < Class < ? > > classesToTransform = new HashSet < Class < ? > > ( ) ; for ( ProbeListener listener : listeners ) { Collection < ProbeImpl > listenerProbes = removeProbesByListener ( listener ) ; for ( ProbeImpl probe : listenerProbes ) { Class < ? > clazz = probe . getSourceClass ( ) ; removeInterestedByClass ( clazz , listener ) ; if ( removeListenerByProbe ( probe , listener ) ) { classesToTransform . add ( clazz ) ; } } } return classesToTransform ; }
|
Process the recently unregistered listeners and calculate which classes need to be transformed to remove deactivated probes .
|
37,891
|
public void classAvailable ( Class < ? > clazz ) { if ( ! isMonitorable ( clazz ) ) { return ; } listenersLock . readLock ( ) . lock ( ) ; try { for ( ProbeListener listener : allRegisteredListeners ) { ProbeFilter filter = listener . getProbeFilter ( ) ; if ( filter . matches ( clazz ) ) { addInterestedByClass ( clazz , Collections . singleton ( listener ) ) ; } } } finally { listenersLock . readLock ( ) . unlock ( ) ; } if ( ! getInterestedByClass ( clazz ) . isEmpty ( ) ) { this . transformer . instrumentWithProbes ( Collections . < Class < ? > > singleton ( clazz ) ) ; } }
|
Process a recently defined class to determine if it needs to be transformed with probes .
|
37,892
|
public synchronized ProbeImpl getProbe ( Class < ? > probedClass , String key ) { Map < String , ProbeImpl > classProbes = probesByKey . get ( probedClass ) ; if ( classProbes != null ) { return classProbes . get ( key ) ; } return null ; }
|
Get an existing instance of a probe with the specified source class and key .
|
37,893
|
public void addActiveProbesforListener ( ProbeListener listener , Collection < ProbeImpl > probes ) { addProbesByListener ( listener , probes ) ; for ( ProbeImpl probe : probes ) { addListenerByProbe ( probe , listener ) ; } }
|
Update the appropriate collections to reflect recently activated probes for the specified listener .
|
37,894
|
void addListenerByProbe ( ProbeImpl probe , ProbeListener listener ) { Set < ProbeListener > listeners = listenersByProbe . get ( probe ) ; if ( listeners == null ) { listeners = new CopyOnWriteArraySet < ProbeListener > ( ) ; listenersByProbe . putIfAbsent ( probe , listeners ) ; listeners = listenersByProbe . get ( probe ) ; } listeners . add ( listener ) ; }
|
Add the specified listener to the collection of listeners associated with the specified probe .
|
37,895
|
boolean removeListenerByProbe ( ProbeImpl probe , ProbeListener listener ) { boolean deactivatedProbe = false ; Set < ProbeListener > listeners = listenersByProbe . get ( probe ) ; if ( listeners != null ) { listeners . remove ( listener ) ; if ( listeners . isEmpty ( ) ) { deactivateProbe ( probe ) ; deactivatedProbe = true ; } } return deactivatedProbe ; }
|
Remove the specified listener from the collection of listeners associated with the specified probe .
|
37,896
|
synchronized void deactivateProbe ( ProbeImpl probe ) { listenersByProbe . remove ( probe ) ; activeProbesById . remove ( probe . getIdentifier ( ) ) ; Class < ? > clazz = probe . getSourceClass ( ) ; Map < String , ProbeImpl > classProbesByKey = probesByKey . get ( clazz ) ; classProbesByKey . remove ( probe . getName ( ) ) ; if ( classProbesByKey . isEmpty ( ) ) { probesByKey . remove ( clazz ) ; } }
|
Deactivate the specified probe and remove all data associated with the probe .
|
37,897
|
synchronized void addProbesByListener ( ProbeListener listener , Collection < ProbeImpl > probes ) { Set < ProbeImpl > listenerProbes = probesByListener . get ( listener ) ; if ( listenerProbes == null ) { listenerProbes = new HashSet < ProbeImpl > ( ) ; probesByListener . put ( listener , listenerProbes ) ; } listenerProbes . addAll ( probes ) ; }
|
Associate the specified collection of probes with the specified listener .
|
37,898
|
synchronized Collection < ProbeImpl > removeProbesByListener ( ProbeListener listener ) { Set < ProbeImpl > listenerProbes = probesByListener . remove ( listener ) ; if ( listenerProbes == null ) { listenerProbes = Collections . emptySet ( ) ; } return listenerProbes ; }
|
Remove all probes that were fired at the specified listener .
|
37,899
|
public boolean isExcludedClass ( String className ) { if ( className . startsWith ( "java/lang/reflect" ) ) { return true ; } if ( className . startsWith ( "sun/misc" ) ) { return true ; } if ( className . startsWith ( "sun/reflect" ) ) { return true ; } if ( className . startsWith ( "com/ibm/oti/" ) ) { return true ; } if ( className . startsWith ( "com/ibm/ws/monitor/internal" ) ) { return true ; } if ( className . startsWith ( "com/ibm/websphere/monitor" ) ) { return true ; } if ( className . startsWith ( "com/ibm/ws/boot/delegated/monitoring" ) ) { return true ; } if ( ( className . startsWith ( "com/ibm/ws/pmi" ) ) || ( className . startsWith ( "com/ibm/websphere/pmi" ) ) || ( className . startsWith ( "com/ibm/wsspi/pmi" ) ) ) { return true ; } if ( ( ! ( probeMonitorSet . contains ( ( className . replace ( "/" , "." ) ) ) ) ) ) { return true ; } return false ; }
|
Determine if the named class is one that should be excluded from monitoring via probe injection . The patterns below generally include classes required to implement JVM function on which the monitoring code depends .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.