idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
161,500
private Collection < String > getCollectionFromSpaceSplitString ( String stringValue ) { //@special handling for @all, @none, @form and @this if ( stringValue . equals ( VAL_FORM ) ) { return VAL_FORM_LIST ; } else if ( stringValue . equals ( VAL_ALL ) ) { return VAL_ALL_LIST ; } else if ( stringValue . equals ( VAL_NONE ) ) { return VAL_NONE_LIST ; } else if ( stringValue . equals ( VAL_THIS ) ) { return VAL_THIS_LIST ; } // not one of the "normal" values - split it and return the Collection String [ ] arrValue = stringValue . split ( " " ) ; return Arrays . asList ( arrValue ) ; }
Splits the String based on spaces and returns the resulting Strings as Collection .
165
16
161,501
public static void traceSetTxCommon ( int opType , String txId , String desc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( TxLifeCycle_Set_Tx_Type_Str ) . append ( DataDelimiter ) . append ( TxLifeCycle_Set_Tx_Type ) . append ( DataDelimiter ) . append ( opType ) . append ( DataDelimiter ) . append ( txId ) . append ( DataDelimiter ) . append ( desc ) ; Tr . debug ( tc , sbuf . toString ( ) ) ; } }
This is called by the EJB container server code to write a set transaction record to the trace log if enabled .
154
23
161,502
public static void traceCommon ( int opType , String txId , String desc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( TxLifeCycle_State_Type_Str ) . append ( DataDelimiter ) . append ( TxLifeCycle_State_Type ) . append ( DataDelimiter ) . append ( opType ) . append ( DataDelimiter ) . append ( txId ) . append ( DataDelimiter ) . append ( desc ) ; Tr . debug ( tc , sbuf . toString ( ) ) ; } }
This is called by the EJB container server code to write a common record to the trace log if enabled .
148
22
161,503
synchronized private JaspiConfig readConfigFile ( final File configFile ) throws PrivilegedActionException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "readConfigFile" , new Object [ ] { configFile } ) ; if ( configFile == null ) { // TODO handle persistence // String msg = MessageFormatHelper.getFormattedMessage(msgBundle, AdminConstants.MSG_JASPI_PERSISTENT_FILE, new Object[] { PersistenceManager.JASPI_CONFIG }); // throw new RuntimeException(msg); } PrivilegedExceptionAction < JaspiConfig > unmarshalFile = new PrivilegedExceptionAction < JaspiConfig > ( ) { @ Override public JaspiConfig run ( ) throws Exception { JaspiConfig cfg = null ; JAXBContext jc = JAXBContext . newInstance ( JaspiConfig . class ) ; Object obj = jc . createUnmarshaller ( ) . unmarshal ( configFile ) ; if ( obj instanceof JaspiConfig ) { cfg = ( JaspiConfig ) obj ; } return cfg ; } } ; JaspiConfig jaspi = AccessController . doPrivileged ( unmarshalFile ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "readConfigFile" , jaspi ) ; return jaspi ; }
Return a Java representation of the JASPI persistent providers that are defined in the given configuration file or null if the object returned by JAXB is not an JaspiConfig instance or an exception is thrown by method AccessController . doPrivileged .
311
51
161,504
synchronized private void writeConfigFile ( final JaspiConfig jaspiConfig ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeConfigFile" , new Object [ ] { jaspiConfig } ) ; if ( configFile == null ) { // TODO handle persistence //String msg = MessageFormatHelper.getFormattedMessage(msgBundle, AdminConstants.MSG_JASPI_PERSISTENT_FILE, new Object[] { PersistenceManager.JASPI_CONFIG }); //throw new RuntimeException(msg); } PrivilegedExceptionAction < Object > marshalFile = new PrivilegedExceptionAction < Object > ( ) { @ Override public Object run ( ) throws Exception { JAXBContext jc = JAXBContext . newInstance ( JaspiConfig . class ) ; Marshaller writer = jc . createMarshaller ( ) ; writer . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , Boolean . TRUE ) ; writer . marshal ( jaspiConfig , configFile ) ; return null ; } } ; try { AccessController . doPrivileged ( marshalFile ) ; } catch ( PrivilegedActionException e ) { FFDCFilter . processException ( e , this . getClass ( ) . getName ( ) + ".writeConfigFile" , "290" , this ) ; throw new RuntimeException ( "Unable to write " + configFile , e ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeConfigFile" ) ; }
Store the in - memory Java representation of the JASPI persistent providers into the given configuration file .
344
20
161,505
public String getRedirectUrlFromServerToClient ( String clientId , String contextPath , String redirectToRPHostAndPort ) { String redirectURL = null ; if ( redirectToRPHostAndPort != null && redirectToRPHostAndPort . length ( ) > 0 ) { try { final String fHostPort = redirectToRPHostAndPort ; @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) URL url = ( URL ) java . security . AccessController . doPrivileged ( new java . security . PrivilegedExceptionAction ( ) { @ Override public Object run ( ) throws Exception { return new URL ( fHostPort ) ; } } ) ; int port = url . getPort ( ) ; String path = url . getPath ( ) ; if ( path == null ) path = "" ; if ( path . endsWith ( "/" ) ) { path = path . substring ( 0 , path . length ( ) - 1 ) ; } String entryPoint = path + contextPath + "/redirect/" + clientId ; redirectURL = url . getProtocol ( ) + "://" + url . getHost ( ) + ( port > 0 ? ":" + port : "" ) ; redirectURL = redirectURL + ( entryPoint . startsWith ( "/" ) ? "" : "/" ) + entryPoint ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "the value of redirectToRPHostAndPort might not valid. Please verify that the format is <protocol>://<host>:<port> " + redirectToRPHostAndPort + "\n" + e . getMessage ( ) ) ; } } } return redirectURL ; }
moved from oidcconfigimpl so social can use it .
386
15
161,506
@ FFDCIgnore ( { IndexOutOfBoundsException . class } ) public boolean validateReqParameters ( ConvergedClientConfig clientConfig , Hashtable < String , String > reqParameters , String cookieValue ) { boolean validCookie = true ; String encoded = null ; String cookieName = "WASOidcCode" ; String requestParameters = null ; try { int lastindex = cookieValue . lastIndexOf ( "_" ) ; if ( lastindex < 1 ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The cookie may have been tampered with." ) ; if ( lastindex < 0 ) { Tr . debug ( tc , "The cookie does not contain an underscore." ) ; } if ( lastindex == 0 ) { Tr . debug ( tc , "The cookie does not contain a value before the underscore." ) ; } } return false ; } encoded = cookieValue . substring ( 0 , lastindex ) ; String testCookie = OidcClientUtil . calculateOidcCodeCookieValue ( encoded , clientConfig ) ; if ( ! cookieValue . equals ( testCookie ) ) { String msg = "The value for the OIDC state cookie [" + cookieName + "] failed validation." ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , msg ) ; } validCookie = false ; } } catch ( IndexOutOfBoundsException e ) { // anything wrong indicated the requestParameter cookie is not right or is not in right format validCookie = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "unexpected exception:" , e ) ; } } if ( validCookie ) { requestParameters = Base64Coder . toString ( Base64Coder . base64DecodeString ( encoded ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "decodedRequestParameters:" + requestParameters ) ; } JsonParser parser = new JsonParser ( ) ; JsonObject jsonObject = ( JsonObject ) parser . parse ( requestParameters ) ; Set < Map . Entry < String , JsonElement > > entries = jsonObject . entrySet ( ) ; for ( Map . Entry < String , JsonElement > entry : entries ) { String key = entry . getKey ( ) ; JsonElement element = entry . getValue ( ) ; if ( element . isJsonObject ( ) || element . isJsonPrimitive ( ) ) { reqParameters . put ( key , element . getAsString ( ) ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "parameterKey:" + key + " value:" + element . getAsString ( ) ) ; } } else { // this should not happen if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "unexpected json element:" + element . getClass ( ) . getName ( ) ) ; } validCookie = false ; } } } return validCookie ; }
This gets called after an auth code or implicit token might have been received . This method examines the encodedReqParameters extracted from the WASOidcCode cookie along with the client config and request params to determine if the params in the cookie are valid .
676
51
161,507
public Boolean verifyState ( HttpServletRequest req , HttpServletResponse res , String responseState , ConvergedClientConfig clientConfig ) { if ( responseState . length ( ) < OidcUtil . STATEVALUE_LENGTH ) { return false ; // the state does not even match the length, the verification failed } long clockSkewMillSeconds = clientConfig . getClockSkewInSeconds ( ) * 1000 ; long allowHandleTimeMillSeconds = ( clientConfig . getAuthenticationTimeLimitInSeconds ( ) * 1000 ) + clockSkewMillSeconds ; // allow 7 minutes plust clockSkew javax . servlet . http . Cookie [ ] cookies = req . getCookies ( ) ; String cookieName = ClientConstants . WAS_OIDC_STATE_KEY + HashUtils . getStrHashCode ( responseState ) ; String stateKey = CookieHelper . getCookieValue ( cookies , cookieName ) ; // this could be null if used OidcClientUtil . invalidateReferrerURLCookie ( req , res , cookieName ) ; String cookieValue = HashUtils . createStateCookieValue ( clientConfig , responseState ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "stateKey:'" + stateKey + "' cookieValue:'" + cookieValue + "'" ) ; } if ( cookieValue . equals ( stateKey ) ) { long lNumber = OidcUtil . convertNormalizedTimeStampToLong ( responseState ) ; long lDate = ( new Date ( ) ) . getTime ( ) ; // lDate can not be earlier than lNumber by clockSkewMillSeconds // lDate can not be later than lNumber by clockSkewMllSecond + allowHandleTimeSeconds long difference = lDate - lNumber ; if ( difference < 0 ) { difference *= - 1 ; if ( difference >= clockSkewMillSeconds ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "error current: " + lDate + " ran at:" + lNumber ) ; } } return difference < clockSkewMillSeconds ; } else { if ( difference >= allowHandleTimeMillSeconds ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "error current: " + lDate + " ran at:" + lNumber ) ; } } return difference < allowHandleTimeMillSeconds ; } } return false ; }
Determine the name of the state cookie based on the state name key + hashcode of response state . Retrieve that cookie value then create a check value by hashing the clinet config and resonseState again . If the hash result equals the cookie value request is valid proceed to check the clock skew .
578
62
161,508
void update ( Dictionary < String , Object > props ) { if ( deleted ) { return ; } final String instancePid = ( String ) props . get ( "service.pid" ) ; final String instanceId = ( String ) props . get ( "id" ) ; if ( instanceId == null ) { Tr . error ( tc , "cls.library.id.missing" ) ; } if ( libraryListenersTracker == null ) { //set up a tracker for notification listeners for this library Filter listenerFilter = null ; // To better support parent first nested config, also filter on libraryRef, // which will be a list of pid (or, if cardinality=0, then just a pid). try { listenerFilter = FrameworkUtil . createFilter ( "(&(objectClass=" + LibraryChangeListener . class . getName ( ) + ")(|(library=" + instanceId + ")(libraryRef=*" + instancePid + "*)))" ) ; } catch ( InvalidSyntaxException e ) { //auto FFDC because the syntax shouldn't be wrong! Tr . error ( tc , "cls.library.id.invalid" , instanceId , e . toString ( ) ) ; } ServiceTracker < LibraryChangeListener , LibraryChangeListener > tracker ; tracker = new ServiceTracker < LibraryChangeListener , LibraryChangeListener > ( this . ctx , listenerFilter , null ) ; tracker . open ( ) ; libraryListenersTracker = tracker ; } LibraryGeneration nextGen ; synchronized ( generationLock ) { nextGen = nextGeneration ; if ( nextGen != null ) { // there is already a new generation in the process of being updated. // since it is using stale properties we want to cancel that generation // and start a new one. nextGeneration = null ; nextGen . cancel ( ) ; } nextGeneration = nextGen = new LibraryGeneration ( this , instanceId , props ) ; } nextGen . fetchFilesets ( ) ; }
called from SharedLibraryFactory inside a synchronized block over this instance
417
12
161,509
public void mapFunction ( String prefix , String fnName , final Class c , final String methodName , final Class [ ] args ) { //192474 start //We can get in to this method with null parameters if a JSP was compiled against the jsp-2.3 feature but running in a jsp-2.2 server. //This check is needed for the temporary JspClassInformation created in AbstractJSPExtensionServletWrapper class. if ( fnName == null ) { return ; } //192474 end java . lang . reflect . Method method ; if ( System . getSecurityManager ( ) != null ) { try { method = ( java . lang . reflect . Method ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws Exception { return c . getDeclaredMethod ( methodName , args ) ; } } ) ; } catch ( PrivilegedActionException ex ) { throw new RuntimeException ( "Invalid function mapping - no such method: " + ex . getException ( ) . getMessage ( ) ) ; } } else { try { method = c . getDeclaredMethod ( methodName , args ) ; } catch ( NoSuchMethodException e ) { throw new RuntimeException ( "Invalid function mapping - no such method: " + e . getMessage ( ) ) ; } } this . fnmap . put ( prefix + ":" + fnName , method ) ; }
Stores a mapping from the given EL function prefix and name to the given Java method .
303
18
161,510
void add ( int event ) { int b = bits . addAndGet ( event ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "add " + event + ", polling state: " + b ) ; }
Add an event without checking if we are ready to start polling .
64
13
161,511
boolean addAndCheckIfReady ( int event ) { int b = bits . addAndGet ( event ) ; boolean isReady = b == READY_WITHOUT_SIGNAL || b == READY_WITH_UNNECESSARY_SIGNAL || b == READY_WITH_SIGNAL ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "addAndCheckIfReady " + event + ", polling state: " + b + ", " + isReady ) ; return isReady ; }
Add an event and then check if we are ready for polling .
127
13
161,512
public int getTransactionTimeout ( ) throws XAException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getTransactionTimeout" ) ; int timeout = 0 ; try { CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putInt ( getTransactionId ( ) ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_XA_GETTXTIMEOUT , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { reply . checkXACommandCompletionStatus ( JFapChannelConstants . SEG_XA_GETTXTIMEOUT_R , getConversation ( ) ) ; timeout = reply . getInt ( ) ; } finally { if ( reply != null ) reply . release ( ) ; } } catch ( XAException xa ) { // No FFDC Code needed // Simply re-throw... throw xa ; } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".getTransactionTimeout" , CommsConstants . SIXARESOURCEPROXY_GETTXTIMEOUT_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Caught a comms problem:" , e ) ; throw new XAException ( XAException . XAER_RMFAIL ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getTransactionTimeout" , "" + timeout ) ; return timeout ; }
Returns the transaction timeout for this XAResource instance .
383
12
161,513
private HashMap < Xid , SIXAResourceProxy > getLinkLevelXAResourceMap ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getLinkLevelXAResourceMap" ) ; HashMap < Xid , SIXAResourceProxy > map = ( ( ClientLinkLevelState ) getConversation ( ) . getLinkLevelAttachment ( ) ) . getXidToXAResourceMap ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getLinkLevelXAResourceMap" , map ) ; return map ; }
Helper method to retrieve the map in the link level state that contains the XAResources and the XId they are currently enlisted with .
167
28
161,514
private String replaceCharacters ( String name ) { name = name . replaceAll ( "&gt;" , ">" ) ; name = name . replaceAll ( "&lt;" , "<" ) ; name = name . replaceAll ( "&amp;" , "&" ) ; name = name . replaceAll ( "<\\%" , "<%" ) ; name = name . replaceAll ( "%\\>" , "%>" ) ; return name ; }
PK40417 Method to replace translated characters to their original form . This prevents compilation errors when escaped characters are used in tags .
92
25
161,515
private boolean handleCaseSensitivityCheck ( String path , boolean checkWEBINF ) throws IOException { if ( System . getSecurityManager ( ) != null ) { final String tmpPath = path ; final boolean tmpCheckWEBINF = checkWEBINF ; //PK81387 try { return ( ( Boolean ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws IOException { return _handleCaseSensitivityCheck ( tmpPath , tmpCheckWEBINF ) ; //PK81387 added tmpCheckWEBINF param } } ) ) . booleanValue ( ) ; } catch ( PrivilegedActionException pae ) { throw ( IOException ) pae . getException ( ) ; } } else { return ( _handleCaseSensitivityCheck ( path , checkWEBINF ) ) . booleanValue ( ) ; //PK81387 added checkWEBINF param } }
PK81387 - added checkWEBINF param
201
12
161,516
public final void nameSpace ( String namespace ) { if ( namespace == null || namespace . equals ( "" ) ) { _namespace = "" ; } else { _namespace = namespace + ":" ; } }
Set the namespace prefix to be prefixed to subseqyent tags . The namespace prefix allow different components to use the same tag without risk of confusion .
44
31
161,517
public final void write ( Throwable e ) throws IOException { indent ( ) ; newLine ( ) ; write ( e . toString ( ) ) ; StackTraceElement [ ] elements = e . getStackTrace ( ) ; for ( int i = 0 ; i < elements . length ; i ++ ) { newLine ( ) ; write ( elements [ i ] . toString ( ) ) ; } Throwable cause = e . getCause ( ) ; if ( cause != null ) { newLine ( ) ; write ( cause . toString ( ) ) ; } outdent ( ) ; }
Write a throwable used to indicate a problem during data collection not formatted .
126
15
161,518
public PublicKey getPublicKeyFromJwk ( String kid , String x5t , boolean useSystemPropertiesForHttpClientConnections ) throws PrivilegedActionException , IOException , KeyStoreException , InterruptedException { return getPublicKeyFromJwk ( kid , x5t , null , useSystemPropertiesForHttpClientConnections ) ; }
Either kid or x5t will work . But not both
74
12
161,519
@ FFDCIgnore ( { KeyStoreException . class } ) public PublicKey getPublicKeyFromJwk ( String kid , String x5t , String use , boolean useSystemPropertiesForHttpClientConnections ) throws PrivilegedActionException , IOException , KeyStoreException , InterruptedException { PublicKey key = null ; KeyStoreException errKeyStoreException = null ; InterruptedException errInterruptedException = null ; boolean isHttp = remoteHttpCall ( this . jwkEndpointUrl , this . publicKeyText , this . keyLocation ) ; try { if ( isHttp ) { key = this . getJwkRemote ( kid , x5t , use , useSystemPropertiesForHttpClientConnections ) ; } else { key = this . getJwkLocal ( kid , x5t , publicKeyText , keyLocation , use ) ; } } catch ( KeyStoreException e ) { errKeyStoreException = e ; } catch ( InterruptedException e ) { errInterruptedException = e ; } if ( key == null ) { if ( errKeyStoreException != null ) { throw errKeyStoreException ; } if ( errInterruptedException != null ) { throw errInterruptedException ; } } return key ; }
Either kid x5t or use will work but not all
261
12
161,520
@ FFDCIgnore ( { PrivilegedActionException . class } ) protected InputStream getInputStream ( final File f , String fileSystemSelector , String location , String classLoadingSelector ) throws IOException { // check file system first like we used to do if ( f != null ) { InputStream is = null ; try { is = ( FileInputStream ) AccessController . doPrivileged ( new PrivilegedExceptionAction < Object > ( ) { @ Override public Object run ( ) throws Exception { if ( f . exists ( ) ) { return new FileInputStream ( f ) ; } else { return null ; } } } ) ; } catch ( PrivilegedActionException e1 ) { } if ( is != null ) { locationUsed = fileSystemSelector ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "input stream obtained from file system and locationUsed set to: " + locationUsed ) ; } return is ; } } // do the expensive classpath search // performant: we're avoiding calling getResource if entry was previously cached. URL u = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( location ) ; locationUsed = classLoadingSelector ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "input stream obtained from classloader and locationUsed set to: " + locationUsed ) ; } if ( u != null ) { return u . openStream ( ) ; } return null ; }
open an input stream to either a file on the file system or a url on the classpath . Update the locationUsed class variable to note where we got the stream from so results of reading it can be cached properly
315
43
161,521
public boolean parseJwk ( String keyText , FileInputStream inputStream , JWKSet jwkset , String signatureAlgorithm ) { boolean bJwk = false ; if ( keyText != null ) { bJwk = parseKeyText ( keyText , locationUsed , jwkset , signatureAlgorithm ) ; } else if ( inputStream != null ) { String keyAsString = getKeyAsString ( inputStream ) ; bJwk = parseKeyText ( keyAsString , locationUsed , jwkset , signatureAlgorithm ) ; } return bJwk ; }
separate to be an independent method for unit tests
126
10
161,522
@ Override public CompletableFuture < T > newIncompleteFuture ( ) { if ( JAVA8 ) return new ManagedCompletionStage < T > ( new CompletableFuture < T > ( ) , defaultExecutor , null ) ; else return new ManagedCompletionStage < T > ( defaultExecutor ) ; }
minimalCompletionStage is allowed because java . util . concurrent . CompletableFuture s minimalCompletionStage allows it
72
25
161,523
@ Override @ SuppressWarnings ( "hiding" ) @ Trivial < T > CompletableFuture < T > newInstance ( CompletableFuture < T > completableFuture , Executor managedExecutor , FutureRefExecutor futureRef ) { return new ManagedCompletionStage < T > ( completableFuture , managedExecutor , futureRef ) ; }
This method is only for Java SE 8 . It is used to override the newInstance method of ManagedCompletableFuture to ensure that newly created instances are ManagedCompletionStage .
81
38
161,524
public void becomeCloneOf ( ManagedObject other ) { final String methodName = "becomeCloneOf" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , other ) ; //!! See transactionDeleteLogRecord as to why this is necessary. //!! The dummy is used where we need to delete something in recovery that is already deleted. //!! Unfortunately a rollback of the original after an OptimisticReplace //!! during recovery will cause classCastException /* * !! DummyManagedObject dummyManagedObject = (DummyManagedObject)other; name = dummyManagedObject.name; !! */ if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
Replace the state of this object with the same object in some other state . Used for to restore the before immage if a transaction rolls back or is read from the log during restart .
187
38
161,525
private boolean setState ( State newState ) { switch ( newState ) { case DEPLOYED : return changeState ( State . DEPLOYING , State . DEPLOYED ) ; case DEPLOYING : //can move from either UNDEPLOYED or FAILED into DEPLOYING state return ( changeState ( State . UNDEPLOYED , State . DEPLOYING ) || changeState ( State . FAILED , State . DEPLOYING ) ) ; case UNDEPLOYING : return changeState ( State . DEPLOYED , State . UNDEPLOYING ) ; case UNDEPLOYED : return changeState ( State . UNDEPLOYING , State . UNDEPLOYED ) ; case FAILED : return changeState ( State . DEPLOYING , State . FAILED ) ; default : return false ; } }
state should only transition while the terminated lock is held .
191
11
161,526
Event createFailedEvent ( Throwable t ) { synchronized ( terminated ) { if ( terminated . get ( ) ) { return null ; } if ( setState ( State . FAILED ) ) { installer . removeWabFromEligibleForCollisionResolution ( this ) ; installer . attemptRedeployOfPreviouslyCollidedContextPath ( this . wabContextPath ) ; return createEvent ( State . FAILED , t , null , null ) ; } } return null ; }
and kicks off the collision resolution process
104
7
161,527
Event createFailedEvent ( String collisionContext , long [ ] cIds ) { synchronized ( terminated ) { if ( terminated . get ( ) ) { return null ; } if ( setState ( State . FAILED ) ) return createEvent ( State . FAILED , null , collisionContext , cIds ) ; } return null ; }
as it s used only to report collision failures = )
73
11
161,528
@ Override @ Trivial public WAB addingBundle ( Bundle bundle , BundleEvent event ) { //the bundle is in STARTING | ACTIVE state because of our state mask //only action work for the bundle represented by this WAB. if ( bundle . getBundleId ( ) == wabBundleId ) { //sync lock inside bundle id check to avoid locking on every bundle! synchronized ( terminated ) { if ( terminated . get ( ) ) { installer . wabLifecycleDebug ( "SubTracker unable to add bundle, as has been terminated." , this , bundle . getBundleId ( ) ) ; //if we are terminated, then the WABGroup will be handling the uninstall //and state transitions.. so it's important not to get involved here. return null ; } installer . wabLifecycleDebug ( "SubTracker adding bundle." , this ) ; //only deploy the wab, if the state is still deploying.. //it pretty much should be.. if ( getState ( ) == State . DEPLOYING ) { installer . wabLifecycleDebug ( "SubTracker adding WAB to WebContainer" , this ) ; //the holder will already have the wab in its list from construction //no collision, just add to the web container - only return the WAB tracked object if successful return addToWebContainer ( ) ? WAB . this : null ; } else { return null ; } } } else { return null ; } }
so we don t want that in the trace all the time
310
12
161,529
public static String identityToString ( Object o ) { return o == null ? null : o . getClass ( ) . getName ( ) + ' ' + Integer . toHexString ( System . identityHashCode ( o ) ) ; }
Returns a string containing a concise human - readable description of the object . The string is the same as the one that would be returned by Object . toString even if the object s class has overriden the toString or hashCode methods . The return value for a null object is null .
51
59
161,530
public static final String getThreadId ( ) { String id = threadids . get ( ) ; if ( null == id ) { // Pad the tid out to 8 characters id = getThreadId ( Thread . currentThread ( ) ) ; threadids . set ( id ) ; } return id ; }
Get and return the thread id padded to 8 characters .
62
11
161,531
public static final String padHexString ( int num , int width ) { final String zeroPad = "0000000000000000" ; String str = Integer . toHexString ( num ) ; final int length = str . length ( ) ; if ( length >= width ) return str ; StringBuilder buffer = new StringBuilder ( zeroPad . substring ( 0 , width ) ) ; buffer . replace ( width - length , width , str ) ; return buffer . toString ( ) ; }
Returns the provided integer padded to the specified number of characters with zeros .
99
15
161,532
public static final String throwableToString ( Throwable t ) { final StringWriter s = new StringWriter ( ) ; final PrintWriter p = new PrintWriter ( s ) ; if ( t == null ) { p . println ( "none" ) ; } else { printStackTrace ( p , t ) ; } return DataFormatHelper . escape ( s . toString ( ) ) ; }
Returns a string containing the formatted exception stack
83
8
161,533
private static final boolean printFieldStackTrace ( PrintWriter p , Throwable t , String className , String fieldName ) { for ( Class < ? > c = t . getClass ( ) ; c != Object . class ; c = c . getSuperclass ( ) ) { if ( c . getName ( ) . equals ( className ) ) { try { Object value = c . getField ( fieldName ) . get ( t ) ; if ( value instanceof Throwable && value != t . getCause ( ) ) { p . append ( fieldName ) . append ( ": " ) ; printStackTrace ( p , ( Throwable ) value ) ; } return true ; } catch ( NoSuchFieldException e ) { } catch ( IllegalAccessException e ) { } } } return false ; }
Find a field value in the class hierarchy of an exception and if the field contains another Throwable then print its stack trace .
171
25
161,534
private String createErrorMsg ( JspLineId jspLineId , int errorLineNr ) { StringBuffer compilerOutput = new StringBuffer ( ) ; if ( jspLineId . getSourceLineCount ( ) <= 1 ) { Object [ ] objArray = new Object [ ] { new Integer ( jspLineId . getStartSourceLineNum ( ) ) , jspLineId . getFilePath ( ) } ; if ( jspLineId . getFilePath ( ) . equals ( jspLineId . getParentFile ( ) ) ) { compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.single.line.number" , objArray ) ) ; // Defect 211450 } else { compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.single.line.number.included.file" , objArray ) ) ; // Defect 211450 } } else { // compute exact JSP line number int actualLineNum = jspLineId . getStartSourceLineNum ( ) + ( errorLineNr - jspLineId . getStartGeneratedLineNum ( ) ) ; if ( actualLineNum >= jspLineId . getStartSourceLineNum ( ) && actualLineNum <= ( jspLineId . getStartSourceLineNum ( ) + jspLineId . getSourceLineCount ( ) - 1 ) ) { Object [ ] objArray = new Object [ ] { new Integer ( actualLineNum ) , jspLineId . getFilePath ( ) } ; if ( jspLineId . getFilePath ( ) . equals ( jspLineId . getParentFile ( ) ) ) { compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.single.line.number" , objArray ) ) ; // Defect 211450 } else { compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.single.line.number.included.file" , objArray ) ) ; // Defect 211450 } } else { Object [ ] objArray = new Object [ ] { new Integer ( jspLineId . getStartSourceLineNum ( ) ) , new Integer ( ( jspLineId . getStartSourceLineNum ( ) ) + jspLineId . getSourceLineCount ( ) - 1 ) , jspLineId . getFilePath ( ) } ; if ( jspLineId . getFilePath ( ) . equals ( jspLineId . getParentFile ( ) ) ) { compilerOutput . append ( separatorString + // Defect 211450 JspCoreException . getMsg ( "jsp.error.multiple.line.number" , objArray ) ) ; } else { compilerOutput . append ( separatorString + // Defect 211450 JspCoreException . getMsg ( "jsp.error.multiple.line.number.included.file" , objArray ) ) ; } } } compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.corresponding.servlet" , new Object [ ] { jspLineId . getParentFile ( ) } ) ) ; // Defect 211450 //152470 starts if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "createErrorMsg" , "The value of the JSP attribute jdkSourceLevel is [" + jdkSourceLevel + "]" ) ; } //152470 ends return compilerOutput . toString ( ) ; }
name of parent file
817
4
161,535
@ SuppressWarnings ( "unchecked" ) public static < T > T getInstanceInitParameter ( ExternalContext context , String name , String deprecatedName , T defaultValue ) { String param = getStringInitParameter ( context , name , deprecatedName ) ; if ( param == null ) { return defaultValue ; } else { try { return ( T ) ClassUtils . classForName ( param ) . newInstance ( ) ; } catch ( Exception e ) { throw new FacesException ( "Error Initializing Object[" + param + "]" , e ) ; } } }
Gets the init parameter value from the specified context and instanciate it . If the parameter was not specified the default value is used instead .
121
30
161,536
public static String escapeLDAPFilterTerm ( String term ) { if ( term == null ) return null ; Matcher m = FILTER_CHARS_TO_ESCAPE . matcher ( term ) ; StringBuffer sb = new StringBuffer ( term . length ( ) ) ; while ( m . find ( ) ) { final String replacement = escapeFilterChar ( m . group ( ) . charAt ( 0 ) ) ; m . appendReplacement ( sb , Matcher . quoteReplacement ( replacement ) ) ; } m . appendTail ( sb ) ; return sb . toString ( ) ; }
Escape a term for use in an LDAP filter .
131
12
161,537
private static Method getBindingMethod ( UIComponent parent ) { Class [ ] clazzes = parent . getClass ( ) . getInterfaces ( ) ; for ( int i = 0 ; i < clazzes . length ; i ++ ) { Class clazz = clazzes [ i ] ; if ( clazz . getName ( ) . indexOf ( "BindingAware" ) != - 1 ) { try { return parent . getClass ( ) . getMethod ( "handleBindings" , new Class [ ] { } ) ; } catch ( NoSuchMethodException e ) { // return } } } return null ; }
This is all a hack to work around a spec - bug which will be fixed in JSF2 . 0
136
22
161,538
public void setObjectClasses ( List < String > objectClasses ) { int size = objectClasses . size ( ) ; iObjectClasses = new ArrayList < String > ( objectClasses . size ( ) ) ; for ( int i = 0 ; i < size ; i ++ ) { String objectClass = objectClasses . get ( i ) . toLowerCase ( ) ; if ( ! iObjectClasses . contains ( objectClass ) ) { iObjectClasses . add ( objectClass ) ; } } }
Sets a list of defining object classes for this entity type . The object classes will be stored in lower case form for comparison .
111
26
161,539
public void setObjectClassesForCreate ( List < String > objectClasses ) { if ( iRDNObjectClass != null && iRDNObjectClass . length > 1 ) { iObjectClassAttrs = new Attribute [ iRDNObjectClass . length ] ; for ( int i = 0 ; i < iRDNObjectClass . length ; i ++ ) { iObjectClassAttrs [ i ] = new BasicAttribute ( LdapConstants . LDAP_ATTR_OBJECTCLASS , iRDNObjectClass [ i ] [ 0 ] ) ; // Remove the object class for create objectClasses . remove ( iRDNObjectClass [ i ] [ 0 ] ) ; } // Add rest auxliary object classes. for ( int i = 0 ; i < iObjectClassAttrs . length ; i ++ ) { for ( int j = 0 ; j < objectClasses . size ( ) ; j ++ ) { iObjectClassAttrs [ i ] . add ( objectClasses . get ( j ) ) ; } } } else { iObjectClassAttrs = new Attribute [ 1 ] ; iObjectClassAttrs [ 0 ] = new BasicAttribute ( LdapConstants . LDAP_ATTR_OBJECTCLASS ) ; if ( objectClasses . size ( ) > 0 ) { for ( int i = 0 ; i < objectClasses . size ( ) ; i ++ ) { iObjectClassAttrs [ 0 ] . add ( objectClasses . get ( i ) ) ; } } else { // If create object class is not define, use object classes for ( int i = 0 ; i < iObjectClasses . size ( ) ; i ++ ) { iObjectClassAttrs [ 0 ] . add ( iObjectClasses . get ( i ) ) ; } } } }
Sets the object classes attribute for creating .
393
9
161,540
public void setRDNAttributes ( List < Map < String , Object > > rdnAttrList ) throws MissingInitPropertyException { int size = rdnAttrList . size ( ) ; // if size = 0, No RDN attributes defined. Same as RDN properties. if ( size > 0 ) { iRDNAttrs = new String [ size ] [ ] ; iRDNObjectClass = new String [ size ] [ ] ; if ( size == 1 ) { Map < String , Object > rdnAttr = rdnAttrList . get ( 0 ) ; String [ ] rdns = LdapHelper . getRDNs ( ( String ) rdnAttr . get ( ConfigConstants . CONFIG_PROP_NAME ) ) ; iRDNAttrs [ 0 ] = rdns ; } else { int i = 0 ; for ( Map < String , Object > rdnAttr : rdnAttrList ) { String name = ( String ) rdnAttr . get ( ConfigConstants . CONFIG_PROP_NAME ) ; String [ ] rdns = LdapHelper . getRDNs ( name ) ; iRDNAttrs [ i ] = rdns ; String [ ] objCls = ( String [ ] ) rdnAttr . get ( ConfigConstants . CONFIG_PROP_OBJECTCLASS ) ; if ( objCls == null ) { throw new MissingInitPropertyException ( WIMMessageKey . MISSING_INI_PROPERTY , Tr . formatMessage ( tc , WIMMessageKey . MISSING_INI_PROPERTY , WIMMessageHelper . generateMsgParms ( ConfigConstants . CONFIG_PROP_OBJECTCLASS ) ) ) ; } else { iRDNObjectClass [ i ] = objCls ; } i ++ ; } } } }
Sets the RDN attribute types of this member type . RDN attribute types will be converted to lower case .
403
23
161,541
public Attribute getObjectClassAttribute ( String dn ) { if ( iObjectClassAttrs . length == 1 || dn == null ) { return iObjectClassAttrs [ 0 ] ; } else { String [ ] rdns = LdapHelper . getRDNAttributes ( dn ) ; for ( int i = 0 ; i < iRDNAttrs . length ; i ++ ) { String [ ] attrs = iRDNAttrs [ i ] ; for ( int j = 0 ; j < attrs . length ; j ++ ) { for ( int k = 0 ; k < attrs . length ; k ++ ) { if ( attrs [ j ] . equals ( rdns [ k ] ) ) { return iObjectClassAttrs [ i ] ; } } } } } return null ; }
Gets the LDAP object class attribute that contains all object classes needed to create the member on LDAP server .
176
23
161,542
public SimpleEntry next ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "next" , this ) ; SibTr . exit ( tc , "next" , this . next ) ; } return this . next ; }
Return the next entry in the list
68
7
161,543
public void remove ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remove" , this ) ; if ( previous != null ) previous . next = next ; else list . first = next ; if ( next != null ) next . previous = previous ; else list . last = previous ; previous = null ; next = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remove" , list . printList ( ) ) ; }
Remove this entry from the list
130
6
161,544
void rank ( MetatypeOcd ocd , List < String > rankedSuffixes ) { List < String > childAliasSuffixes = new LinkedList < String > ( ) ; for ( String suffix : rankedSuffixes ) if ( ! childAliasSuffixes . contains ( suffix ) ) { MetatypeOcd collision = unavailableSuffixes . put ( suffix , ocd ) ; if ( collision == null ) childAliasSuffixes . add ( suffix ) ; else { List < String > suffixesForCollisionOCD = rankings . get ( collision ) ; if ( suffixesForCollisionOCD != null ) suffixesForCollisionOCD . remove ( suffix ) ; } } rankings . put ( ocd , childAliasSuffixes ) ; }
Specifies rankings for child alias suffixes .
173
9
161,545
void reserve ( String suffix , MetatypeOcd ocd ) { MetatypeOcd previous = unavailableSuffixes . put ( suffix , ocd ) ; if ( previous != null ) throw new IllegalArgumentException ( "aliasSuffix: " + suffix ) ; }
Reserve a child alias suffix so that no one else can claim it . This method should only be used when an aliasSuffix override is specified in wlp - ra . xml .
61
38
161,546
private CapabilityMatchingResult matchCapability ( Collection < ? extends ProvisioningFeatureDefinition > features ) { String capabilityString = esaResource . getProvisionCapability ( ) ; if ( capabilityString == null ) { CapabilityMatchingResult result = new CapabilityMatchingResult ( ) ; result . capabilitySatisfied = true ; result . features = Collections . emptyList ( ) ; return result ; } CapabilityMatchingResult result = new CapabilityMatchingResult ( ) ; result . capabilitySatisfied = true ; result . features = new ArrayList <> ( ) ; List < FeatureCapabilityInfo > capabilityMaps = createCapabilityMaps ( features ) ; for ( Filter filter : createFilterList ( ) ) { boolean matched = false ; for ( FeatureCapabilityInfo capabilityInfo : capabilityMaps ) { if ( filter . matches ( capabilityInfo . capabilities ) ) { matched = true ; result . features . add ( capabilityInfo . feature ) ; break ; } } // If any of the filters in the provision capability header don't match, we're not satisfied if ( ! matched ) { result . capabilitySatisfied = false ; } } return result ; }
Attempt to match the ProvisionCapability requirements against the given list of features
244
14
161,547
public String getAssetURL ( String id ) { String url = getRepositoryUrl ( ) + "/assets/" + id + "?" ; if ( getUserId ( ) != null ) { url += "userId=" + getUserId ( ) ; } if ( getUserId ( ) != null && getPassword ( ) != null ) { url += "&password=" + getPassword ( ) ; } if ( getApiKey ( ) != null ) { url += "&apiKey=" + getApiKey ( ) ; } return url ; }
Returns a URL which represent the URL that can be used to view the asset in Massive . This is more for testing purposes the assets can be access programatically via various methods on this class .
117
38
161,548
public String getTaskUsage ( ExeAction task ) { StringBuilder taskUsage = new StringBuilder ( NL ) ; // print a empty line taskUsage . append ( getHelpPart ( "global.usage" ) ) ; taskUsage . append ( NL ) ; taskUsage . append ( ' ' ) ; taskUsage . append ( COMMAND ) ; taskUsage . append ( ' ' ) ; taskUsage . append ( task ) ; taskUsage . append ( " [" ) ; taskUsage . append ( getHelpPart ( "global.options.lower" ) ) ; taskUsage . append ( "]" ) ; List < String > options = task . getCommandOptions ( ) ; for ( String option : options ) { if ( option . charAt ( 0 ) != ' ' ) { taskUsage . append ( ' ' ) ; taskUsage . append ( option ) ; } } taskUsage . append ( NL ) ; taskUsage . append ( NL ) ; taskUsage . append ( getHelpPart ( "global.description" ) ) ; taskUsage . append ( NL ) ; taskUsage . append ( getDescription ( task ) ) ; taskUsage . append ( NL ) ; if ( options . size ( ) > 0 ) { taskUsage . append ( NL ) ; taskUsage . append ( getHelpPart ( "global.options" ) ) ; for ( String option : task . getCommandOptions ( ) ) { taskUsage . append ( NL ) ; String optionKey ; try { optionKey = getHelpPart ( task + ".option-key." + option ) ; } catch ( MissingResourceException e ) { // This happens because we don't have a message for the key for the // license arguments but these are not translated and don't need any // arguments after them so can just use the option optionKey = " " + option ; } taskUsage . append ( optionKey ) ; taskUsage . append ( NL ) ; taskUsage . append ( getHelpPart ( task + ".option-desc." + option ) ) ; taskUsage . append ( NL ) ; } } taskUsage . append ( NL ) ; return taskUsage . toString ( ) ; }
Constructs a string to represent the usage for a particular task .
446
13
161,549
private int getQueueIndex ( Object [ ] queue , java . util . concurrent . atomic . AtomicInteger counter , boolean increment ) { // fast path for single element array if ( queue . length == 1 ) { return 0 ; } else if ( increment ) { // get the next long value from counter int i = counter . incrementAndGet ( ) ; // rollover logic to make sure we stay within // the bounds of an integer. Not important that // this logic is highly accurate, ballpark is okay. if ( i > MAX_COUNTER ) { if ( counter . compareAndSet ( i , 0 ) ) { System . out . println ( "BoundedBuffer: reset counter to 0" ) ; } } return i % queue . length ; } else { return counter . get ( ) % queue . length ; } }
has waited .
171
3
161,550
public void put ( Object x ) throws InterruptedException { if ( x == null ) { throw new IllegalArgumentException ( ) ; } // D186845 if (Thread.interrupted()) // D186845 throw new InterruptedException(); // D312598 - begin boolean ret = false ; while ( true ) { synchronized ( lock ) { if ( numberOfUsedSlots . get ( ) < buffer . length ) { insert ( x ) ; numberOfUsedSlots . getAndIncrement ( ) ; ret = true ; } } if ( ret ) { notifyGet_ ( ) ; return ; } int spinctr = SPINS_PUT_ ; while ( numberOfUsedSlots . get ( ) >= buffer . length ) { // busy wait if ( spinctr > 0 ) { if ( YIELD_PUT_ ) Thread . yield ( ) ; spinctr -- ; } else { // block on lock waitPut_ ( WAIT_SHORT_SLICE_ ) ; } } } // D312598 - end }
Puts an object into the buffer . If the buffer is full the call will block indefinitely until space is freed up .
218
24
161,551
@ Override public void setTarget ( String target ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setTarget" , target ) ; } _target = target ; }
Set the target property .
61
5
161,552
@ Override public void setTargetType ( String targetType ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setTargetType" , targetType ) ; } _targetType = targetType ; }
Set the target type property .
67
6
161,553
@ Override public void setMaxSequentialMessageFailure ( final String maxSequentialMessageFailure ) { _maxSequentialMessageFailure = ( maxSequentialMessageFailure == null ? null : Integer . valueOf ( maxSequentialMessageFailure ) ) ; }
Set the MaxSequentialMessageFailure property
53
8
161,554
@ Override public void setAutoStopSequentialMessageFailure ( final String autoStopSequentialMessageFailure ) { _autoStopSequentialMessageFailure = ( autoStopSequentialMessageFailure == null ? null : Integer . valueOf ( autoStopSequentialMessageFailure ) ) ; }
Set the AutoStopSequentialMessageFailure property
58
9
161,555
public static UOWScopeCallback createUserTransactionCallback ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createUserTransactionCallback" ) ; if ( userTranCallback == null ) { userTranCallback = new LTCUOWCallback ( UOW_TYPE_TRANSACTION ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createUserTransactionCallback" , userTranCallback ) ; return userTranCallback ; }
may be different in derived classes
106
6
161,556
public static X509Name getInstance ( ASN1TaggedObject obj , boolean explicit ) { return getInstance ( ASN1Sequence . getInstance ( obj , explicit ) ) ; }
Return a X509Name based on the passed in tagged object .
40
13
161,557
public Vector getOIDs ( ) { Vector v = new Vector ( ) ; for ( int i = 0 ; i != ordering . size ( ) ; i ++ ) { v . addElement ( ordering . elementAt ( i ) ) ; } return v ; }
return a vector of the oids in the name in the order they were found .
54
17
161,558
public Vector getValues ( ) { Vector v = new Vector ( ) ; for ( int i = 0 ; i != values . size ( ) ; i ++ ) { v . addElement ( values . elementAt ( i ) ) ; } return v ; }
return a vector of the values found in the name in the order they were found .
53
17
161,559
public static ConfigID fromProperty ( String property ) { //TODO Perhaps there is a clever regex that could handle this String [ ] parents = property . split ( "//" ) ; ConfigID id = null ; for ( String parentString : parents ) { id = constructId ( id , parentString ) ; } return id ; }
Translate config . id back into an ConfigID object
70
11
161,560
@ Override public Conversation connect ( InetSocketAddress remoteHost , ConversationReceiveListener arl , String chainName ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "connect" , new Object [ ] { remoteHost , arl , chainName } ) ; if ( initialisationFailed ) { String nlsMsg = nls . getFormattedMessage ( "EXCP_CONN_FAIL_NO_CF_SICJ0007" , null , null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "connection failed because comms failed to initialise" ) ; throw new SIResourceException ( nlsMsg ) ; } Conversation conversation = tracker . connect ( remoteHost , arl , chainName , Conversation . CLIENT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "connect" , conversation ) ; return conversation ; }
Implementation of the connect method provided by our abstract parent . Attempts to establish a conversation to the specified remote host using the appropriate chain . This may involve creating a new connection or reusing an existing one . The harder part is doing this in such a way as to avoid blocking all calls while processing a single new outbound connection attempt .
251
68
161,561
public static void initialise ( ) throws SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initialise" ) ; initialisationFailed = true ; Framework framework = Framework . getInstance ( ) ; if ( framework != null ) { tracker = new OutboundConnectionTracker ( framework ) ; initialisationFailed = false ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "initialisation failed" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initialise" ) ; }
Initialises the Client Connection Manager .
165
7
161,562
private void destroy ( ) { final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; if ( bTrace && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Session being destroyed; " + this ) ; } // List<HttpSessionListener> list = this.myConfig.getSessionListeners(); // if (null != list) { // HttpSessionEvent event = new HttpSessionEvent(this); // for (HttpSessionListener listener : list) { // if (bTrace && tc.isDebugEnabled()) { // Tr.debug(tc, "Notifying listener of destroy; " + listener); // } // listener.sessionDestroyed(event); // } // } for ( String key : this . attributes . keySet ( ) ) { Object value = this . attributes . get ( key ) ; HttpSessionBindingEvent event = new HttpSessionBindingEvent ( this , key ) ; if ( value instanceof HttpSessionBindingListener ) { if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Notifying attribute of removal: " + value ) ; } ( ( HttpSessionBindingListener ) value ) . valueUnbound ( event ) ; } } this . attributes . clear ( ) ; this . myContext = null ; }
Once a session has been invalidated this will perform final cleanup and notifying any listeners .
287
18
161,563
private void cleanup ( ) { final String methodName = "cleanup(): " ; try { final Bundle b = bundle . getAndSet ( null ) ; if ( b != null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + "Uninstalling bundle location: " + b . getLocation ( ) + ", bundle id: " + b . getBundleId ( ) ) ; } SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { try { b . uninstall ( ) ; return null ; } catch ( BundleException ignored ) { return null ; } } } ) ; } else { b . uninstall ( ) ; } } } catch ( BundleException ignored ) { } catch ( IllegalStateException ignored ) { } }
Cleans up the TCCL instance . Once called this TCCL is effectively disabled . It s associated gateway bundle will have been removed .
194
29
161,564
int decrementRefCount ( ) { final String methodName = "decrementRefCount(): " ; final int count = refCount . decrementAndGet ( ) ; if ( count < 0 ) { // more destroys than creates if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " refCount < 0 - too many calls to destroy/cleaup" , new Throwable ( "stack trace" ) ) ; } } if ( count == 0 ) { cleanup ( ) ; } return count ; }
The ClassLoadingService implementation should call this method when it s destroyThreadContextClassLoader method is called . Each call to destroyTCCL should decrement this ref counter . When there are no more references to this TCCL it will be cleaned up which effectively invalidates it .
125
57
161,565
private static PersistenceContext newPersistenceContext ( final String fJndiName , final String fUnitName , final int fCtxType , final List < Property > fCtxProperties ) { return new PersistenceContext ( ) { @ Override public Class < ? extends Annotation > annotationType ( ) { return PersistenceContext . class ; } @ Override public String name ( ) { return fJndiName ; } @ Override public PersistenceProperty [ ] properties ( ) { //TODO not ideal doing this conversion processing here PersistenceProperty [ ] props = new PersistenceProperty [ fCtxProperties . size ( ) ] ; int i = 0 ; for ( Property property : fCtxProperties ) { final String name = property . getName ( ) ; final String value = property . getValue ( ) ; PersistenceProperty prop = new PersistenceProperty ( ) { @ Override public Class < ? extends Annotation > annotationType ( ) { return PersistenceProperty . class ; } @ Override public String name ( ) { return name ; } @ Override public String value ( ) { return value ; } } ; props [ i ++ ] = prop ; } return props ; } @ Override public PersistenceContextType type ( ) { if ( fCtxType == PersistenceContextRef . TYPE_TRANSACTION ) { return PersistenceContextType . TRANSACTION ; } else { return PersistenceContextType . EXTENDED ; } } @ Override public String unitName ( ) { return fUnitName ; } @ Override public String toString ( ) { return "JPA.PersistenceContext(name=" + fJndiName + ", unitName=" + fUnitName + ")" ; } } ; }
This transient PersistenceContext annotation class has no default value . i . e . null is a valid value for some fields .
369
25
161,566
private void processConnectionInfo ( CommsByteBuffer buffer , Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "processConnectionInfo" , new Object [ ] { buffer , conversation } ) ; ClientConversationState convState = ( ClientConversationState ) conversation . getAttachment ( ) ; short connectionObjectId = buffer . getShort ( ) ; // BIT16 ConnectionObjectID String meName = buffer . getString ( ) ; // STR MEName // Set the connection object ID in the conversation state convState . setConnectionObjectID ( connectionObjectId ) ; // Create the connection proxy and save it away in the conversation state final ConnectionProxy connectionProxy ; // The type of connection proxy we create is dependent on FAP version. Fap version 5 supports // a connection which MSSIXAResourceProvider. This is done so that PEV (introduced in line with // FAP 5) can perform remote recovery of resources. if ( conversation . getHandshakeProperties ( ) . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_5 ) { connectionProxy = new MSSIXAResourceProvidingConnectionProxy ( conversation ) ; } else { connectionProxy = new ConnectionProxy ( conversation ) ; } convState . setSICoreConnection ( connectionProxy ) ; // Set in the ME name connectionProxy . setMeName ( meName ) ; // Now get the unique Id if there was one, and set it in the connection proxy short idLength = buffer . getShort ( ) ; if ( idLength != 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Got unique id of length:" , idLength ) ; byte [ ] uniqueId = buffer . get ( idLength ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . bytes ( tc , uniqueId ) ; connectionProxy . setInitialUniqueId ( uniqueId ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "No unique Id was returned" ) ; } // Get the ME Uuid String meUuid = buffer . getString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "ME Uuid: " , meUuid ) ; connectionProxy . setMeUuid ( meUuid ) ; // Get the resolved User Id String resolvedUserId = buffer . getString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Resolved UserId: " , resolvedUserId ) ; connectionProxy . setResolvedUserId ( resolvedUserId ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processConnectionInfo" ) ; }
This method will process the connection information received from our peer . At the moment this consists of the connection object ID required at the server the name of the messaging engine and the ME Uuid .
677
38
161,567
private void processSchema ( CommsByteBuffer buffer , Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processSchema" , new Object [ ] { buffer , conversation } ) ; ClientConversationState convState = ( ClientConversationState ) conversation . getAttachment ( ) ; byte [ ] mfpDataAsBytes = buffer . getRemaining ( ) ; // Get hold of the CommsConnection associated with this conversation CommsConnection cc = convState . getCommsConnection ( ) ; // Get hold of MFP Singleton and pass it the schema try { // Get hold of product version final HandshakeProperties handshakeGroup = conversation . getHandshakeProperties ( ) ; final int productVersion = handshakeGroup . getMajorVersion ( ) ; // Get hold of MFP and inform it of the schema CompHandshake ch = ( CompHandshake ) CompHandshakeFactory . getInstance ( ) ; ch . compData ( cc , productVersion , mfpDataAsBytes ) ; } catch ( Exception e1 ) { FFDCFilter . processException ( e1 , CLASS_NAME + ".processSchema" , CommsConstants . PROXYRECEIVELISTENER_PROCESSSCHEMA_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "MFP unable to create CompHandshake Singleton" , e1 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processSchema" ) ; }
This method will process a schema received from our peer s MFP compoennt . At the moment this consists of contacting MFP here on the client and giving it the schema . Schemas are received when the ME is about to send us a message and realises that we don t have the necessary schema to decode it . A High priority message is then sent ahead of the data ensuring that by the time the message is received the schema will be understood .
370
92
161,568
private void processSyncMessageChunk ( CommsByteBuffer buffer , Conversation conversation , boolean connectionMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "processSyncMessageChunk" , new Object [ ] { buffer , conversation , connectionMessage } ) ; // First get the ConnectionProxy for this conversation ClientConversationState convState = ( ClientConversationState ) conversation . getAttachment ( ) ; ConnectionProxy connProxy = ( ConnectionProxy ) convState . getSICoreConnection ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Found connection: " , connProxy ) ; // Now read the connection object Id buffer . getShort ( ) ; // BIT16 ConnectionObjId if ( connectionMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Adding message part directly to connection" ) ; connProxy . addMessagePart ( buffer ) ; } else { short consumerSessionId = buffer . getShort ( ) ; // BIT16 ConsumerSessionId if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Consumer Session Id:" , "" + consumerSessionId ) ; // Now simply pass the message buffer off to the consumer ConsumerSessionProxy consumer = connProxy . getConsumerSessionProxy ( consumerSessionId ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Found consumer:" , consumer ) ; consumer . addMessagePart ( buffer ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "processSyncMessageChunk" ) ; }
Processes a chunk received from a synchronous message .
429
11
161,569
public BeanO getBean ( ContainerTx tx , BeanId id ) { return id . getActivationStrategy ( ) . atGet ( tx , id ) ; }
Return bean from cache for given transaction bean id . Return null if no entry in cache .
36
18
161,570
public void commitBean ( ContainerTx tx , BeanO bean ) { bean . getActivationStrategy ( ) . atCommit ( tx , bean ) ; }
Perform commit - time processing for the specified transaction and bean . This method should be called for each bean which was participating in a transaction which was successfully committed .
35
32
161,571
public void unitOfWorkEnd ( ContainerAS as , BeanO bean ) { bean . getActivationStrategy ( ) . atUnitOfWorkEnd ( as , bean ) ; }
LIDB441 . 5 - added
38
8
161,572
public void rollbackBean ( ContainerTx tx , BeanO bean ) { bean . getActivationStrategy ( ) . atRollback ( tx , bean ) ; }
Perform rollback - time processing for the specified transaction and bean . This method should be called for each bean which was participating in a transaction which was rolled back .
36
33
161,573
public final void enlistBean ( ContainerTx tx , BeanO bean ) { bean . getActivationStrategy ( ) . atEnlist ( tx , bean ) ; }
Perform actions required when a bean is enlisted in a transaction at some point in time other than at activation . Used only for beans using TX_BEAN_MANAGED .
36
36
161,574
public void terminate ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "terminate" ) ; statefulBeanReaper . cancel ( ) ; //d601399 // Force a reaper sweep statefulBeanReaper . finalSweep ( passivator ) ; beanCache . terminate ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "terminate" ) ; }
Enable cleanup of passivated beans kind of a hack required because all the bean s homes have already been cleaned up at this point
117
25
161,575
synchronized long calculateNextExpiration ( ) { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "calculateNextExpiration: " + this ) ; ivLastExpiration = ivExpiration ; // 598265 if ( ivParsedScheduleExpression != null ) { // F7437591.codRev - getNextTimeout returns -1 for "no more timeouts", // but this class uses ivExpiration=0. ivExpiration = Math . max ( 0 , ivParsedScheduleExpression . getNextTimeout ( ivExpiration ) ) ; } else { if ( ivInterval > 0 ) { ivExpiration += ivInterval ; // 597753 } else { ivExpiration = 0 ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "calculateNextExpiration: " + ivExpiration ) ; // 597753 return ivExpiration ; }
Calculate the next time that the timer should fire .
233
12
161,576
public static void removeTimersByJ2EEName ( J2EEName j2eeName ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "removeTimersByJ2EEName: " + j2eeName ) ; Collection < TimerNpImpl > timersToRemove = null ; // Although this seems inefficient, removing all of the timers for an // application or module that is stopping is done in two steps to avoid // obtaining locks on both the active timers map and any individual // timer concurrently. Many methods on a timer will also need to obtain // the lock on the active timers map as well, so the two step approach // avoids the possibility of deadlock. RTC107334 synchronized ( svActiveTimers ) { if ( svActiveTimers . size ( ) > 0 ) { String appToRemove = j2eeName . getApplication ( ) ; String modToRemove = j2eeName . getModule ( ) ; for ( TimerNpImpl timer : svActiveTimers . values ( ) ) { J2EEName timerJ2EEName = timer . ivBeanId . j2eeName ; if ( appToRemove . equals ( timerJ2EEName . getApplication ( ) ) && ( modToRemove == null || modToRemove . equals ( timerJ2EEName . getModule ( ) ) ) ) { // save the timer to be removed outside the active timers map lock if ( timersToRemove == null ) { timersToRemove = new ArrayList < TimerNpImpl > ( ) ; } timersToRemove . add ( timer ) ; } } } } if ( timersToRemove != null ) { for ( TimerNpImpl timer : timersToRemove ) { timer . remove ( true ) ; // permanently remove the timer; cannot be rolled back } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeTimersByJ2EEName: removed " + ( timersToRemove != null ? timersToRemove . size ( ) : 0 ) ) ; }
Removes all timers associated with the specified application or module .
471
12
161,577
public void statisticCreated ( SPIStatistic s ) { if ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "statisticCreated" , "Servlet statistic created with id=" + s . getId ( ) ) ; if ( s . getId ( ) == LOADED_SERVLETS ) { sgLoadedServlets = ( SPICountStatistic ) s ; } else if ( s . getId ( ) == NUM_RELOADS ) { sgNumReloads = ( SPICountStatistic ) s ; } }
use ID defined in template to identify a statistic
157
9
161,578
public EJBModuleMetaDataImpl createEJBModuleMetaDataImpl ( EJBApplicationMetaData ejbAMD , // F743-4950 ModuleInitData mid , SfFailoverCache statefulFailoverCache , EJSContainer container ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createEJBModuleMetaDataImpl" ) ; EJBJar ejbJar = mid . ivEJBJar ; EJBModuleMetaDataImpl mmd = mid . createModuleMetaData ( ejbAMD ) ; mmd . ivInitData = mid ; mmd . ivMetadataComplete = mid . ivMetadataComplete ; mmd . ivJ2EEName = mid . ivJ2EEName ; mmd . ivName = mid . ivName ; mmd . ivAppName = mid . ivAppName ; mmd . ivLogicalName = mid . ivLogicalName ; mmd . ivApplicationExceptionMap = createApplicationExceptionMap ( ejbJar ) ; mmd . ivModuleVersion = ejbJar == null ? BeanMetaData . J2EE_EJB_VERSION_3_0 : ejbJar . getVersionID ( ) ; // Determine if the SetRollbackOnly behavior should be as it was in 2.x // modules (where SetRollbackOnly would need to be invoked within the // actual EJB instance), or use the 3.x behavior (where // SetRollbackOnly can be invoke within and ejb instance that is itself // invoked from within the ejb instance that began the transaction). // For EJB 3.x applications, the LimitSetRollbackOnlyBehaviorToInstanceFor property // is usd to indicate that the 2.x behavior should be used. // Likewise, 2.x applications can use the ExtendSetRollbackOnlyBehaviorBeyondInstanceFor // property to get the 3.x behavior. // d461917.1 if ( mmd . ivModuleVersion >= BeanMetaData . J2EE_EJB_VERSION_3_0 ) { if ( ( LimitSetRollbackOnlyBehaviorToInstanceFor == null ) || ( ! LimitSetRollbackOnlyBehaviorToInstanceFor . contains ( mmd . ivAppName ) ) ) { mmd . ivUseExtendedSetRollbackOnlyBehavior = true ; } } else { // not a 3.0 module if ( ( ExtendSetRollbackOnlyBehaviorBeyondInstanceFor != null ) && ( ExtendSetRollbackOnlyBehaviorBeyondInstanceFor . contains ( "*" ) || ExtendSetRollbackOnlyBehaviorBeyondInstanceFor . contains ( mmd . ivAppName ) ) ) { mmd . ivUseExtendedSetRollbackOnlyBehavior = true ; } } // Get the failover instance ID and SFSB Failover value to use for this module if // a SfFailoverCache object was created. if ( statefulFailoverCache != null ) { mmd . ivSfsbFailover = getSFSBFailover ( mmd , container ) ; mmd . ivFailoverInstanceId = getFailoverInstanceId ( mmd , statefulFailoverCache ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createEJBModuleMetaDataImpl: " + mmd ) ; return mmd ; }
Create the EJB Container s internal module metadata object and fill in the data from the metadata framework s generic ModuleDataObject . This occurs at application start time .
745
32
161,579
public void processDeferredBMD ( BeanMetaData bmd ) throws EJBConfigurationException , ContainerException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "processDeferredBMD: " + bmd . j2eeName ) ; // F743-506 - Process automatic timers. This always needs to be // done regardless of deferred EJB initialization. if ( bmd . ivInitData . ivTimerMethods == null ) { processAutomaticTimerMetaData ( bmd ) ; } // d659020 - Clear references that aren't needed for deferred init. bmd . ivInitData . unload ( ) ; bmd . wccm . unload ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processDeferredBMD" ) ; }
Perform metadata processing for a bean that is being deferred .
207
12
161,580
@ SuppressWarnings ( "deprecation" ) protected Throwable getNestedException ( Throwable t ) { Throwable root = t ; for ( ; ; ) { if ( root instanceof RemoteException ) { RemoteException re = ( RemoteException ) root ; if ( re . detail == null ) break ; root = re . detail ; } else if ( root instanceof NamingException ) { NamingException ne = ( NamingException ) root ; if ( ne . getRootCause ( ) == null ) break ; root = ne . getRootCause ( ) ; } else if ( root instanceof com . ibm . ws . exception . WsNestedException ) { //d121522 com . ibm . ws . exception . WsNestedException ne = ( com . ibm . ws . exception . WsNestedException ) root ; if ( ne . getCause ( ) == null ) break ; root = ne . getCause ( ) ; } else { break ; } } return root ; }
d494984 eliminate assignment to parameter t .
219
10
161,581
private void initializeManagedObjectFactoryOrConstructor ( BeanMetaData bmd ) throws EJBConfigurationException { if ( bmd . isManagedBean ( ) ) { bmd . ivEnterpriseBeanFactory = getManagedBeanManagedObjectFactory ( bmd , bmd . enterpriseBeanClass ) ; // If the managed object factroy and the managed object instances will perform all injection // and interceptor processing, then save that indication and reset all of the methodinfos so // that AroundInvoke is not handled by the EJB Container. Injection, PostConstruct, and // PreDestroy will also be skipped. if ( bmd . ivEnterpriseBeanFactory != null && bmd . ivEnterpriseBeanFactory . managesInjectionAndInterceptors ( ) ) { bmd . managedObjectManagesInjectionAndInterceptors = true ; if ( bmd . ivInterceptorMetaData != null && bmd . localMethodInfos != null ) { for ( EJBMethodInfoImpl mbMethod : bmd . localMethodInfos ) { mbMethod . setAroundInterceptorProxies ( null ) ; } } } } else { bmd . ivEnterpriseBeanFactory = getEJBManagedObjectFactory ( bmd , bmd . enterpriseBeanClass ) ; } if ( bmd . ivEnterpriseBeanFactory == null ) { try { bmd . ivEnterpriseBeanClassConstructor = bmd . enterpriseBeanClass . getConstructor ( ( Class < ? > [ ] ) null ) ; } catch ( NoSuchMethodException e ) { Tr . error ( tc , "JIT_NO_DEFAULT_CTOR_CNTR5007E" , new Object [ ] { bmd . enterpriseBeanClassName , bmd . enterpriseBeanName } ) ; throw new EJBConfigurationException ( "CNTR5007E: The " + bmd . enterpriseBeanClassName + " bean class for the " + bmd . enterpriseBeanName + " bean does not have a public constructor that does not take parameters." ) ; } } // Removed else clause that calls bmd.ivEnterpriseBeanFactory.getConstructor() because this method // is called before cdiMMD.setWebBeansContext(webBeansContext) in LibertySingletonServer. If we call // getConstructor before setting the webBeansContext, we default to a constructor that may not be correct. // eg. returning no-arg constructor when multi-arg constructor injection should be invoked. }
Create the appropriate ManagedObjectFactory for the bean type or obtain the constructor if a ManagedObjectFactory will not be used .
550
26
161,582
private void initializeEntityConstructor ( BeanMetaData bmd ) throws EJBConfigurationException { try { bmd . ivEnterpriseBeanClassConstructor = bmd . enterpriseBeanClass . getConstructor ( ( Class < ? > [ ] ) null ) ; } catch ( NoSuchMethodException e ) { Tr . error ( tc , "JIT_NO_DEFAULT_CTOR_CNTR5007E" , new Object [ ] { bmd . enterpriseBeanClassName , bmd . enterpriseBeanName } ) ; throw new EJBConfigurationException ( "CNTR5007E: The " + bmd . enterpriseBeanClassName + " bean class for the " + bmd . enterpriseBeanName + " bean does not have a public constructor that does not take parameters." ) ; } }
Obtain the constructor for the entity bean concrete class .
180
11
161,583
protected < T > ManagedObjectFactory < T > getManagedBeanManagedObjectFactory ( BeanMetaData bmd , Class < T > klass ) throws EJBConfigurationException { ManagedObjectFactory < T > factory = null ; ManagedObjectService managedObjectService = getManagedObjectService ( ) ; if ( managedObjectService != null ) { try { factory = managedObjectService . createManagedObjectFactory ( bmd . _moduleMetaData , klass , true ) ; //TODO the isManaged method could be moved to the ManagedObjectService and then wouldn't need to create the factory if ( ! factory . isManaged ( ) ) { factory = null ; } } catch ( ManagedObjectException e ) { throw new EJBConfigurationException ( e ) ; } } return factory ; }
Gets a managed object factory for the specified ManagedBean class or null if instances of the class do not need to be managed .
180
28
161,584
protected < T > ManagedObjectFactory < T > getInterceptorManagedObjectFactory ( BeanMetaData bmd , Class < T > klass ) throws EJBConfigurationException { ManagedObjectFactory < T > factory = null ; ManagedObjectService managedObjectService = getManagedObjectService ( ) ; if ( managedObjectService != null ) { try { factory = managedObjectService . createInterceptorManagedObjectFactory ( bmd . _moduleMetaData , klass ) ; //TODO the isManaged method could be moved to the ManagedObjectService and then wouldn't need to create the factory if ( ! factory . isManaged ( ) ) { factory = null ; } } catch ( ManagedObjectException e ) { throw new EJBConfigurationException ( e ) ; } } return factory ; }
Gets a managed object factory for the specified interceptor class or null if instances of the class do not need to be managed .
178
26
161,585
protected < T > ManagedObjectFactory < T > getEJBManagedObjectFactory ( BeanMetaData bmd , Class < T > klass ) throws EJBConfigurationException { ManagedObjectFactory < T > factory = null ; ManagedObjectService managedObjectService = getManagedObjectService ( ) ; if ( managedObjectService != null ) { try { factory = managedObjectService . createEJBManagedObjectFactory ( bmd . _moduleMetaData , klass , bmd . j2eeName . getComponent ( ) ) ; //TODO the isManaged method could be moved to the ManagedObjectService and then wouldn't need to create the factory if ( ! factory . isManaged ( ) ) { factory = null ; } } catch ( ManagedObjectException e ) { throw new EJBConfigurationException ( e ) ; } } return factory ; }
Gets a managed object factory for the specified EJB class or null if instances of the class do not need to be managed .
191
26
161,586
private ClassLoader getWrapperProxyClassLoader ( BeanMetaData bmd , Class < ? > intf ) // F58064 throws EJBConfigurationException { // Wrapper proxies are intended to support application restart scenarios. // In order to allow GC of the target EJB class loader when the // application stops, the wrapper proxy class must not be defined by the // target EJB class loader. Instead, we directly define the class on the // class loader of the interface. ClassLoader loader = intf . getClassLoader ( ) ; // Classes defined by the boot class loader (i.e., java.lang.Runnable) // have a null class loader. if ( loader != null ) { try { loader . loadClass ( BusinessLocalWrapperProxy . class . getName ( ) ) ; return loader ; } catch ( ClassNotFoundException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unable to load EJSLocalWrapperProxy for " + intf . getName ( ) + " from " + loader ) ; } } // The class loader of the interface did not have visibility to our // com.ibm.ejs.container classes, which is required. Attempt to use the // server class loader instead. loader = bmd . container . getEJBRuntime ( ) . getServerClassLoader ( ) ; try { if ( loader . loadClass ( intf . getName ( ) ) == intf ) { return loader ; } } catch ( ClassNotFoundException ex ) { // Nothing. } // The server class loader did not have visibility to the interface // class. The interface was probably loaded by a non-runtime bundle that // didn't import com.ibm.ejs.container. Just use the application class // loader even though this will prevent it from being garbage collected, // and it will do the wrong thing for package-private methods in // no-interface view. return bmd . classLoader ; // d727494 }
Returns a class loader that can be used to define a proxy for the specified interface .
432
17
161,587
private Constructor < ? > getWrapperProxyConstructor ( BeanMetaData bmd , String proxyClassName , Class < ? > interfaceClass , Method [ ] methods ) // F58064 throws EJBConfigurationException , ClassNotFoundException { ClassLoader proxyClassLoader = getWrapperProxyClassLoader ( bmd , interfaceClass ) ; Class < ? > [ ] interfaces = new Class < ? > [ ] { interfaceClass } ; Class < ? > proxyClass = JITDeploy . generateEJBWrapperProxy ( proxyClassLoader , proxyClassName , interfaces , methods , bmd . container . getEJBRuntime ( ) . getClassDefiner ( ) ) ; // F70650 try { return proxyClass . getConstructor ( WrapperProxyState . class ) ; } catch ( NoSuchMethodException ex ) { throw new IllegalStateException ( ex ) ; } }
Defines a wrapper proxy class and obtains its constructor that accepts a WrapperProxyStte .
187
20
161,588
private static boolean hasEmptyThrowsClause ( Method method ) { for ( Class < ? > klass : method . getExceptionTypes ( ) ) { // Per CTS, callback methods can declare unchecked exceptions on the // throws clause. if ( ! RuntimeException . class . isAssignableFrom ( klass ) && ! Error . class . isAssignableFrom ( klass ) ) { return false ; } } return true ; }
Returns true if the specified method has an empty throws clause .
92
12
161,589
private void dealWithUnsatisifedXMLTimers ( Map < String , List < com . ibm . ws . javaee . dd . ejb . Timer > > timers1ParmByMethodName , Map < String , List < com . ibm . ws . javaee . dd . ejb . Timer > > timers0ParmByMethodName , BeanMetaData bmd ) throws EJBConfigurationException { String oneMethodInError = null ; String last1ParmError = dealWithUnsatisfiedXMLTimers ( timers1ParmByMethodName , bmd ) ; String last0ParmError = dealWithUnsatisfiedXMLTimers ( timers0ParmByMethodName , bmd ) ; //We log all the methods-in-error, but we only explicitly callout one of them in the exception, and it doesn't matter which one we pick. if ( last1ParmError != null ) { oneMethodInError = last1ParmError ; } else { if ( last0ParmError != null ) { oneMethodInError = last0ParmError ; } } if ( oneMethodInError != null ) { throw new EJBConfigurationException ( "CNTR0210: The " + bmd . j2eeName . getComponent ( ) + " enterprise bean in the " + bmd . j2eeName . getModule ( ) + " module has an automatic timer configured in the deployment descriptor for the " + oneMethodInError + " method, but no timeout callback method with that name was found." ) ; } }
Verifies that every timer defined in xml was successfully associated with a Method .
350
15
161,590
private boolean hasTimeoutCallbackParameters ( MethodMap . MethodInfo methodInfo ) { int numParams = methodInfo . getNumParameters ( ) ; return numParams == 0 || ( numParams == 1 && methodInfo . getParameterType ( 0 ) == Timer . class ) ; }
Returns true if the specified method has the proper parameter types for a timeout callback method .
61
17
161,591
private void addTimerToCorrectMap ( Map < String , List < com . ibm . ws . javaee . dd . ejb . Timer > > timers1ParmByMethodName , Map < String , List < com . ibm . ws . javaee . dd . ejb . Timer > > timers0ParmByMethodName , Map < String , List < com . ibm . ws . javaee . dd . ejb . Timer > > timersUnspecifiedParmByMethodName , int parmCount , String methodName , com . ibm . ws . javaee . dd . ejb . Timer timer ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; Map < String , List < com . ibm . ws . javaee . dd . ejb . Timer > > mapToUse = null ; if ( parmCount == 0 ) { mapToUse = timers0ParmByMethodName ; } else if ( parmCount == 1 ) { mapToUse = timers1ParmByMethodName ; } else { mapToUse = timersUnspecifiedParmByMethodName ; } List < com . ibm . ws . javaee . dd . ejb . Timer > timerList = mapToUse . get ( methodName ) ; if ( timerList == null ) { timerList = new ArrayList < com . ibm . ws . javaee . dd . ejb . Timer > ( ) ; mapToUse . put ( methodName , timerList ) ; } if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "found XML timer for method " + methodName ) ; } timerList . add ( timer ) ; }
Sticks a timer defined in xml into the correct list based on the number of parameters specified in xml for the timer .
388
24
161,592
private EJBMethodInfoImpl findMethodInEJBMethodInfoArray ( EJBMethodInfoImpl [ ] methodInfos , final Method targetMethod ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "findMethodInEJBMethodInfoArray for method \"" + targetMethod . toString ( ) + "\"" ) ; } for ( EJBMethodInfoImpl info : methodInfos ) { if ( targetMethod . equals ( info . getMethod ( ) ) ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "findMethodInEJBMethodInfoArray found EJBMethodInfoImpl for method \"" + targetMethod . toString ( ) + "\"" ) ; } return info ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "findMethodInEJBMethodInfoArray did not find EJBMethodInfoImpl for method \"" + targetMethod . toString ( ) + "\"" ) ; } return null ; }
d494984 . 1 - added entire method
253
10
161,593
private void removeTemporaryMethodData ( BeanMetaData bmd ) { bmd . methodsExposedOnLocalHomeInterface = null ; bmd . methodsExposedOnLocalInterface = null ; bmd . methodsExposedOnRemoteHomeInterface = null ; bmd . methodsExposedOnRemoteInterface = null ; bmd . allPublicMethodsOnBean = null ; bmd . methodsToMethodInfos = null ; }
Removes temporary lists of data from BMD when they are no longer needed .
89
16
161,594
public SIBusMessage next ( ) throws SISessionUnavailableException , SISessionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIBrowserSession . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIBrowserSession . tc , "next" , this ) ; JsMessage msg = null ; synchronized ( this ) { //Check that the session is not closed, if it is throw an exception checkNotClosed ( ) ; //if the browse cursor is null - it was pub sub - this //session will never return any messages if ( _browseCursor != null ) { try { //Get the next item from the browseCursor and cast it //to a SIMPMessage msg = _browseCursor . next ( ) ; } catch ( SISessionDroppedException e ) { // MessageStoreException shouldn't occur so FFDC. FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.BrowserSessionImpl.next" , "1:265:1.78.1.7" , this ) ; close ( ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.BrowserSessionImpl" , "1:274:1.78.1.7" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIBrowserSession . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIBrowserSession . tc , "next" , e ) ; throw e ; } catch ( SIResourceException e ) { // MessageStoreException shouldn't occur so FFDC. FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.BrowserSessionImpl.next" , "1:287:1.78.1.7" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.BrowserSessionImpl" , "1:294:1.78.1.7" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIBrowserSession . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIBrowserSession . tc , "next" , e ) ; throw e ; } } //end if } //end sync if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIBrowserSession . tc , "next" , msg ) ; return msg ; }
Gets the next item from the BrowseCursor .
659
11
161,595
public void close ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIBrowserSession . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIBrowserSession . tc , "close" , this ) ; synchronized ( this ) { if ( ! _closed ) //if we're closed already, don't bother doing anything. { //dereference from the parent connection _conn . removeBrowserSession ( this ) ; _close ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIBrowserSession . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIBrowserSession . tc , "close" ) ; }
Close this BrowserSession ... Dereference from the parent connection and set the closed flag to true .
155
20
161,596
void checkNotClosed ( ) throws SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkNotClosed" ) ; synchronized ( this ) { if ( _closed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" , "Object closed" ) ; throw new SISessionUnavailableException ( nls . getFormattedMessage ( "OBJECT_CLOSED_ERROR_CWSIP0081" , new Object [ ] { _dest . getName ( ) , _dest . getMessageProcessor ( ) . getMessagingEngineName ( ) } , null ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" ) ; }
Check if the session is closed . If the closed flag is set to true throw an exception .
214
19
161,597
public DestinationHandler getNamedDestination ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getNamedDestination" ) ; SibTr . exit ( tc , "getNamedDestination" , _dest ) ; } return _dest ; }
Returns the destination that the session was created against
76
9
161,598
public String getUserAgent ( FacesContext facesContext ) { if ( userAgent == null ) { synchronized ( this ) { if ( userAgent == null ) { Map < String , String [ ] > requestHeaders = facesContext . getExternalContext ( ) . getRequestHeaderValuesMap ( ) ; if ( requestHeaders != null && requestHeaders . containsKey ( "User-Agent" ) ) { String [ ] userAgents = requestHeaders . get ( "User-Agent" ) ; userAgent = userAgents . length > 0 ? userAgents [ 0 ] : null ; } } } } return userAgent ; }
This information will get stored as it cannot change during the session anyway .
134
14
161,599
public static BigInteger decode ( String s ) { byte [ ] bytes = Base64 . decodeBase64 ( s ) ; BigInteger bi = new BigInteger ( 1 , bytes ) ; return bi ; }
This is in use by FAT only at the writing time
42
11