idx
int64 0
165k
| question
stringlengths 73
5.81k
| target
stringlengths 5
918
|
---|---|---|
161,900 | public static final String getThreadId ( ) { String id = threadids . get ( ) ; if ( null == id ) { id = getThreadId ( Thread . currentThread ( ) ) ; threadids . set ( id ) ; } return id ; } | Get and return the thread id padded to 8 characters . |
161,901 | 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 . |
161,902 | 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 |
161,903 | 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 . |
161,904 | 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 ) ) ; } else { compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.single.line.number.included.file" , objArray ) ) ; } } else { 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 ) ) ; } else { compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.single.line.number.included.file" , objArray ) ) ; } } 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 + JspCoreException . getMsg ( "jsp.error.multiple.line.number" , objArray ) ) ; } else { compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.multiple.line.number.included.file" , objArray ) ) ; } } } compilerOutput . append ( separatorString + JspCoreException . getMsg ( "jsp.error.corresponding.servlet" , new Object [ ] { jspLineId . getParentFile ( ) } ) ) ; 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 + "]" ) ; } return compilerOutput . toString ( ) ; } | name of parent file |
161,905 | @ 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 . |
161,906 | 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 . |
161,907 | 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 null ; } | This is all a hack to work around a spec - bug which will be fixed in JSF2 . 0 |
161,908 | 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 . |
161,909 | 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 ] ) ; objectClasses . remove ( iRDNObjectClass [ i ] [ 0 ] ) ; } 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 { for ( int i = 0 ; i < iObjectClasses . size ( ) ; i ++ ) { iObjectClassAttrs [ 0 ] . add ( iObjectClasses . get ( i ) ) ; } } } } | Sets the object classes attribute for creating . |
161,910 | public void setRDNAttributes ( List < Map < String , Object > > rdnAttrList ) throws MissingInitPropertyException { int size = rdnAttrList . size ( ) ; 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 . |
161,911 | 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 . |
161,912 | 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 |
161,913 | 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 |
161,914 | 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 . |
161,915 | 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 . |
161,916 | 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 ( ! matched ) { result . capabilitySatisfied = false ; } } return result ; } | Attempt to match the ProvisionCapability requirements against the given list of features |
161,917 | 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 . |
161,918 | public String getTaskUsage ( ExeAction task ) { StringBuilder taskUsage = new StringBuilder ( NL ) ; taskUsage . append ( getHelpPart ( "global.usage" ) ) ; taskUsage . append ( NL ) ; taskUsage . append ( '\t' ) ; 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 ) { 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 . |
161,919 | private int getQueueIndex ( Object [ ] queue , java . util . concurrent . atomic . AtomicInteger counter , boolean increment ) { if ( queue . length == 1 ) { return 0 ; } else if ( increment ) { int i = counter . incrementAndGet ( ) ; 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 . |
161,920 | public void put ( Object x ) throws InterruptedException { if ( x == null ) { throw new IllegalArgumentException ( ) ; } 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 ) { if ( spinctr > 0 ) { if ( YIELD_PUT_ ) Thread . yield ( ) ; spinctr -- ; } else { waitPut_ ( WAIT_SHORT_SLICE_ ) ; } } } } | Puts an object into the buffer . If the buffer is full the call will block indefinitely until space is freed up . |
161,921 | public void setTarget ( String target ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setTarget" , target ) ; } _target = target ; } | Set the target property . |
161,922 | public void setTargetType ( String targetType ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setTargetType" , targetType ) ; } _targetType = targetType ; } | Set the target type property . |
161,923 | public void setMaxSequentialMessageFailure ( final String maxSequentialMessageFailure ) { _maxSequentialMessageFailure = ( maxSequentialMessageFailure == null ? null : Integer . valueOf ( maxSequentialMessageFailure ) ) ; } | Set the MaxSequentialMessageFailure property |
161,924 | public void setAutoStopSequentialMessageFailure ( final String autoStopSequentialMessageFailure ) { _autoStopSequentialMessageFailure = ( autoStopSequentialMessageFailure == null ? null : Integer . valueOf ( autoStopSequentialMessageFailure ) ) ; } | Set the AutoStopSequentialMessageFailure property |
161,925 | 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 |
161,926 | public static X509Name getInstance ( ASN1TaggedObject obj , boolean explicit ) { return getInstance ( ASN1Sequence . getInstance ( obj , explicit ) ) ; } | Return a X509Name based on the passed in tagged object . |
161,927 | 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 . |
161,928 | 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 . |
161,929 | public static ConfigID fromProperty ( String property ) { 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 |
161,930 | 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 . |
161,931 | 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 . |
161,932 | private void destroy ( ) { final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; if ( bTrace && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Session being destroyed; " + this ) ; } 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 . |
161,933 | 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 > ( ) { 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 . |
161,934 | int decrementRefCount ( ) { final String methodName = "decrementRefCount(): " ; final int count = refCount . decrementAndGet ( ) ; if ( count < 0 ) { 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 . |
161,935 | private static PersistenceContext newPersistenceContext ( final String fJndiName , final String fUnitName , final int fCtxType , final List < Property > fCtxProperties ) { return new PersistenceContext ( ) { public Class < ? extends Annotation > annotationType ( ) { return PersistenceContext . class ; } public String name ( ) { return fJndiName ; } public PersistenceProperty [ ] properties ( ) { 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 ( ) { public Class < ? extends Annotation > annotationType ( ) { return PersistenceProperty . class ; } public String name ( ) { return name ; } public String value ( ) { return value ; } } ; props [ i ++ ] = prop ; } return props ; } public PersistenceContextType type ( ) { if ( fCtxType == PersistenceContextRef . TYPE_TRANSACTION ) { return PersistenceContextType . TRANSACTION ; } else { return PersistenceContextType . EXTENDED ; } } public String unitName ( ) { return fUnitName ; } 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 . |
161,936 | 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 ( ) ; String meName = buffer . getString ( ) ; convState . setConnectionObjectID ( connectionObjectId ) ; final ConnectionProxy connectionProxy ; if ( conversation . getHandshakeProperties ( ) . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_5 ) { connectionProxy = new MSSIXAResourceProvidingConnectionProxy ( conversation ) ; } else { connectionProxy = new ConnectionProxy ( conversation ) ; } convState . setSICoreConnection ( connectionProxy ) ; connectionProxy . setMeName ( meName ) ; 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" ) ; } String meUuid = buffer . getString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "ME Uuid: " , meUuid ) ; connectionProxy . setMeUuid ( meUuid ) ; 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 . |
161,937 | 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 ( ) ; CommsConnection cc = convState . getCommsConnection ( ) ; try { final HandshakeProperties handshakeGroup = conversation . getHandshakeProperties ( ) ; final int productVersion = handshakeGroup . getMajorVersion ( ) ; 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 . |
161,938 | private void processSyncMessageChunk ( CommsByteBuffer buffer , Conversation conversation , boolean connectionMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "processSyncMessageChunk" , new Object [ ] { buffer , conversation , connectionMessage } ) ; ClientConversationState convState = ( ClientConversationState ) conversation . getAttachment ( ) ; ConnectionProxy connProxy = ( ConnectionProxy ) convState . getSICoreConnection ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Found connection: " , connProxy ) ; buffer . getShort ( ) ; 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 ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Consumer Session Id:" , "" + consumerSessionId ) ; 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 . |
161,939 | 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 . |
161,940 | 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 . |
161,941 | public void unitOfWorkEnd ( ContainerAS as , BeanO bean ) { bean . getActivationStrategy ( ) . atUnitOfWorkEnd ( as , bean ) ; } | LIDB441 . 5 - added |
161,942 | 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 . |
161,943 | 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 . |
161,944 | public void terminate ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "terminate" ) ; statefulBeanReaper . cancel ( ) ; 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 |
161,945 | public void uninstallBean ( J2EEName homeName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "uninstallBean " + homeName ) ; BeanO cacheMember ; J2EEName cacheHomeName ; Iterator < ? > statefulBeans ; int numEnumerated = 0 , numRemoved = 0 , numTimedout = 0 ; Enumeration < ? > enumerate = beanCache . enumerateElements ( ) ; while ( enumerate . hasMoreElements ( ) ) { cacheMember = ( BeanO ) ( ( CacheElement ) enumerate . nextElement ( ) ) . getObject ( ) ; BeanId cacheMemberBeanId = cacheMember . getId ( ) ; cacheHomeName = cacheMemberBeanId . getJ2EEName ( ) ; numEnumerated ++ ; if ( cacheHomeName . equals ( homeName ) ) { HomeInternal home = cacheMember . getHome ( ) ; BeanMetaData bmd = cacheMemberBeanId . getBeanMetaData ( ) ; if ( EJSPlatformHelper . isZOS ( ) && bmd . isPassivationCapable ( ) ) { try { home . getActivationStrategy ( ) . atPassivate ( cacheMemberBeanId ) ; } catch ( Exception ex ) { Tr . warning ( tc , "UNABLE_TO_PASSIVATE_EJB_CNTR0005W" , new Object [ ] { cacheMemberBeanId , this , ex } ) ; } } else { home . getActivationStrategy ( ) . atUninstall ( cacheMemberBeanId , cacheMember ) ; } numRemoved ++ ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , beanCache . getName ( ) + ": Uninstalled " + numRemoved + " bean instances (total = " + numEnumerated + ")" ) ; } statefulBeans = statefulBeanReaper . getPassivatedStatefulBeanIds ( homeName ) ; while ( statefulBeans . hasNext ( ) ) { BeanId beanId = ( BeanId ) statefulBeans . next ( ) ; if ( EJSPlatformHelper . isZOS ( ) ) { statefulBeanReaper . remove ( beanId ) ; } else { beanId . getActivationStrategy ( ) . atUninstall ( beanId , null ) ; } numTimedout ++ ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Passivated Beans: Uninstalled " + numTimedout + " bean instances" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "uninstallBean" ) ; } | Uninstall a bean identified by the J2EEName . This is a partial solution to the general problem of how we can quiesce beans . Uninstalling a bean requires us to enumerate the whole bean cache We attempt to find beans which have the same J2EEName as the bean we are uninstalling . We then fire the uninstall event on the activation strategy . It is upto the activation strategy to decide whether to remove the bean or not . |
161,946 | synchronized long calculateNextExpiration ( ) { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "calculateNextExpiration: " + this ) ; ivLastExpiration = ivExpiration ; if ( ivParsedScheduleExpression != null ) { ivExpiration = Math . max ( 0 , ivParsedScheduleExpression . getNextTimeout ( ivExpiration ) ) ; } else { if ( ivInterval > 0 ) { ivExpiration += ivInterval ; } else { ivExpiration = 0 ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "calculateNextExpiration: " + ivExpiration ) ; return ivExpiration ; } | Calculate the next time that the timer should fire . |
161,947 | public static void removeTimersByJ2EEName ( J2EEName j2eeName ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "removeTimersByJ2EEName: " + j2eeName ) ; Collection < TimerNpImpl > timersToRemove = null ; 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 ( ) ) ) ) { if ( timersToRemove == null ) { timersToRemove = new ArrayList < TimerNpImpl > ( ) ; } timersToRemove . add ( timer ) ; } } } } if ( timersToRemove != null ) { for ( TimerNpImpl timer : timersToRemove ) { timer . remove ( true ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeTimersByJ2EEName: removed " + ( timersToRemove != null ? timersToRemove . size ( ) : 0 ) ) ; } | Removes all timers associated with the specified application or module . |
161,948 | 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 |
161,949 | public EJBModuleMetaDataImpl createEJBModuleMetaDataImpl ( EJBApplicationMetaData ejbAMD , 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 ( ) ; if ( mmd . ivModuleVersion >= BeanMetaData . J2EE_EJB_VERSION_3_0 ) { if ( ( LimitSetRollbackOnlyBehaviorToInstanceFor == null ) || ( ! LimitSetRollbackOnlyBehaviorToInstanceFor . contains ( mmd . ivAppName ) ) ) { mmd . ivUseExtendedSetRollbackOnlyBehavior = true ; } } else { if ( ( ExtendSetRollbackOnlyBehaviorBeyondInstanceFor != null ) && ( ExtendSetRollbackOnlyBehaviorBeyondInstanceFor . contains ( "*" ) || ExtendSetRollbackOnlyBehaviorBeyondInstanceFor . contains ( mmd . ivAppName ) ) ) { mmd . ivUseExtendedSetRollbackOnlyBehavior = true ; } } 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 . |
161,950 | public void processDeferredBMD ( BeanMetaData bmd ) throws EJBConfigurationException , ContainerException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "processDeferredBMD: " + bmd . j2eeName ) ; if ( bmd . ivInitData . ivTimerMethods == null ) { processAutomaticTimerMetaData ( bmd ) ; } bmd . ivInitData . unload ( ) ; bmd . wccm . unload ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processDeferredBMD" ) ; } | Perform metadata processing for a bean that is being deferred . |
161,951 | private void initializeLifecycleInterceptorMethodMD ( Method [ ] ejbMethods , List < ContainerTransaction > transactionList , List < ActivitySessionMethod > activitySessionList , BeanMetaData bmd ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "initializeLifecycleInterceptorMethodMD" , ( Object [ ] ) ejbMethods ) ; final int numMethods = LifecycleInterceptorWrapper . NUM_METHODS ; String [ ] methodNames = new String [ numMethods ] ; Class < ? > [ ] [ ] methodParamTypes = new Class < ? > [ numMethods ] [ ] ; String [ ] methodSignatures = new String [ numMethods ] ; TransactionAttribute [ ] transactionAttrs = new TransactionAttribute [ numMethods ] ; ActivitySessionAttribute [ ] activitySessionAttrs = new ActivitySessionAttribute [ numMethods ] ; for ( int i = 0 ; i < numMethods ; i ++ ) { if ( ejbMethods [ i ] == null ) { methodNames [ i ] = LifecycleInterceptorWrapper . METHOD_NAMES [ i ] ; methodParamTypes [ i ] = LifecycleInterceptorWrapper . METHOD_PARAM_TYPES [ i ] ; methodSignatures [ i ] = LifecycleInterceptorWrapper . METHOD_SIGNATURES [ i ] ; transactionAttrs [ i ] = bmd . type == InternalConstants . TYPE_STATEFUL_SESSION ? TransactionAttribute . TX_NOT_SUPPORTED : TransactionAttribute . TX_REQUIRED ; } else { methodNames [ i ] = ejbMethods [ i ] . getName ( ) ; methodParamTypes [ i ] = ejbMethods [ i ] . getParameterTypes ( ) ; methodSignatures [ i ] = MethodAttribUtils . methodSignatureOnly ( ejbMethods [ i ] ) ; } } initializeBeanMethodTransactionAttributes ( false , false , MethodInterface . LIFECYCLE_INTERCEPTOR , ejbMethods , null , null , transactionList , activitySessionList , methodNames , methodParamTypes , methodSignatures , transactionAttrs , activitySessionAttrs , bmd ) ; EJBMethodInfoImpl [ ] methodInfos = new EJBMethodInfoImpl [ numMethods ] ; int slotSize = bmd . container . getEJBRuntime ( ) . getMetaDataSlotSize ( MethodMetaData . class ) ; for ( int i = 0 ; i < numMethods ; i ++ ) { String methodSig = ejbMethods [ i ] == null ? methodNames [ i ] + MethodAttribUtils . METHOD_ARGLIST_SEP + methodSignatures [ i ] : MethodAttribUtils . methodSignature ( ejbMethods [ i ] ) ; String jdiMethodSig = ejbMethods [ i ] == null ? LifecycleInterceptorWrapper . METHOD_JDI_SIGNATURES [ i ] : MethodAttribUtils . jdiMethodSignature ( ejbMethods [ i ] ) ; EJBMethodInfoImpl methodInfo = bmd . createEJBMethodInfoImpl ( slotSize ) ; methodInfo . initializeInstanceData ( methodSig , methodNames [ i ] , bmd , MethodInterface . LIFECYCLE_INTERCEPTOR , transactionAttrs [ i ] , false ) ; methodInfo . setMethodDescriptor ( jdiMethodSig ) ; methodInfo . setActivitySessionAttribute ( activitySessionAttrs [ i ] ) ; methodInfos [ i ] = methodInfo ; } bmd . lifecycleInterceptorMethodInfos = methodInfos ; bmd . lifecycleInterceptorMethodNames = methodNames ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "initializeLifecycleInterceptorMethodMD" ) ; } | Initialize lifecycleInterceptorMethodInfos and lifecycleInterceptorMethodNames fields in the specified BeanMetaData . |
161,952 | @ 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 ) { 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 . |
161,953 | private void processSingletonConcurrencyManagementType ( BeanMetaData bmd ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processSingletonConcurrencyManagementType" ) ; } ConcurrencyManagementType ddType = null ; Session sessionBean = ( Session ) bmd . wccm . enterpriseBean ; if ( sessionBean != null ) { int type = sessionBean . getConcurrencyManagementTypeValue ( ) ; if ( type == Session . CONCURRENCY_MANAGEMENT_TYPE_CONTAINER ) { ddType = ConcurrencyManagementType . CONTAINER ; } else if ( type == Session . CONCURRENCY_MANAGEMENT_TYPE_BEAN ) { ddType = ConcurrencyManagementType . BEAN ; } } ConcurrencyManagementType annotationType = null ; if ( bmd . metadataComplete == false ) { Class < ? > ejbClass = bmd . enterpriseBeanClass ; ConcurrencyManagement annotation = ejbClass . getAnnotation ( javax . ejb . ConcurrencyManagement . class ) ; if ( annotation != null ) { annotationType = annotation . value ( ) ; if ( annotationType != ConcurrencyManagementType . CONTAINER && annotationType != ConcurrencyManagementType . BEAN ) { Tr . error ( tc , "SINGLETON_INVALID_CONCURRENCY_MANAGEMENT_CNTR0193E" , new Object [ ] { annotationType , bmd . enterpriseBeanClassName } ) ; throw new EJBConfigurationException ( "CNTR0193E: The value, " + annotationType + ", that is specified for the concurrency management type of the " + bmd . enterpriseBeanClassName + " enterprise bean class must be either BEAN or CONTAINER." ) ; } } } if ( ddType == null ) { if ( annotationType != null ) { bmd . ivSingletonUsesBeanManagedConcurrency = ( annotationType == ConcurrencyManagementType . BEAN ) ; } else { bmd . ivSingletonUsesBeanManagedConcurrency = false ; } } else { if ( annotationType != null && ddType != annotationType ) { Tr . error ( tc , "SINGLETON_XML_OVERRIDE_CONCURRENCY_MANAGEMENT_CNTR0194E" , new Object [ ] { ddType , annotationType , bmd . enterpriseBeanClassName } ) ; throw new EJBConfigurationException ( "CNTR0194E: The value " + ddType + " that is specified in the ejb-jar.xml file for concurrency management type is not the same " + " as the @ConcurrencyManagement annotation value " + annotationType + " on the " + bmd . enterpriseBeanClassName + " enterprise bean class." ) ; } bmd . ivSingletonUsesBeanManagedConcurrency = ( ddType == ConcurrencyManagementType . BEAN ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "processSingletonConcurrencyManagementType returning " + bmd . ivSingletonUsesBeanManagedConcurrency + " for j2ee name = " + bmd . j2eeName ) ; } } | F743 - 1752CodRev rewrote to do error checking and validation . |
161,954 | private void initializeManagedObjectFactoryOrConstructor ( BeanMetaData bmd ) throws EJBConfigurationException { if ( bmd . isManagedBean ( ) ) { bmd . ivEnterpriseBeanFactory = getManagedBeanManagedObjectFactory ( bmd , bmd . enterpriseBeanClass ) ; 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." ) ; } } } | Create the appropriate ManagedObjectFactory for the bean type or obtain the constructor if a ManagedObjectFactory will not be used . |
161,955 | 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 . |
161,956 | 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 ) ; 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 . |
161,957 | 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 ) ; 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 . |
161,958 | 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 ( ) ) ; 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 . |
161,959 | private ClassLoader getWrapperProxyClassLoader ( BeanMetaData bmd , Class < ? > intf ) throws EJBConfigurationException { ClassLoader loader = intf . getClassLoader ( ) ; 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 ) ; } } loader = bmd . container . getEJBRuntime ( ) . getServerClassLoader ( ) ; try { if ( loader . loadClass ( intf . getName ( ) ) == intf ) { return loader ; } } catch ( ClassNotFoundException ex ) { } return bmd . classLoader ; } | Returns a class loader that can be used to define a proxy for the specified interface . |
161,960 | private Constructor < ? > getWrapperProxyConstructor ( BeanMetaData bmd , String proxyClassName , Class < ? > interfaceClass , Method [ ] methods ) 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 ( ) ) ; 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 . |
161,961 | private static boolean hasEmptyThrowsClause ( Method method ) { for ( Class < ? > klass : method . getExceptionTypes ( ) ) { if ( ! RuntimeException . class . isAssignableFrom ( klass ) && ! Error . class . isAssignableFrom ( klass ) ) { return false ; } } return true ; } | Returns true if the specified method has an empty throws clause . |
161,962 | 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 ) ; 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 . |
161,963 | 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 . |
161,964 | 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 . |
161,965 | 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 |
161,966 | protected void processReferenceContext ( BeanMetaData bmd ) throws InjectionException , EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "ensureReferenceDataIsProcessed" ) ; ReferenceContext refContext = bmd . ivReferenceContext ; refContext . process ( ) ; bmd . _javaNameSpaceContext = refContext . getJavaCompContext ( ) ; bmd . setJavaNameSpace ( refContext . getComponentNameSpace ( ) ) ; bmd . _resourceRefList = refContext . getResolvedResourceRefs ( ) ; bmd . ivJavaColonCompEnvMap = refContext . getJavaColonCompEnvMap ( ) ; bmd . envProps = refContext . getEJBContext10Properties ( ) ; bmd . ivBeanInjectionTargets = getInjectionTargets ( bmd , bmd . enterpriseBeanClass ) ; InterceptorMetaData imd = bmd . ivInterceptorMetaData ; if ( imd != null ) { Class < ? > [ ] interceptorClasses = imd . ivInterceptorClasses ; if ( interceptorClasses != null && interceptorClasses . length > 0 ) { InjectionTarget [ ] [ ] interceptorInjectionTargets = new InjectionTarget [ interceptorClasses . length ] [ 0 ] ; for ( int i = 0 ; i < interceptorClasses . length ; i ++ ) { Class < ? > oneInterceptorClass = interceptorClasses [ i ] ; InjectionTarget [ ] targets = getInjectionTargets ( bmd , oneInterceptorClass ) ; interceptorInjectionTargets [ i ] = targets ; } imd . ivInterceptorInjectionTargets = interceptorInjectionTargets ; } if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Interceptor metadata after adding any InjectionTargets:\n" + imd ) ; } if ( ! EJSPlatformHelper . isZOSCRA ( ) ) { findAndProcessExtendedPC ( bmd ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "ensureReferenceDataIsProcessed" ) ; } | Ensure that reference data is processed and that the resulting output data structures are stuffed in BeanMetaData . |
161,967 | 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 . |
161,968 | 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 ) { checkNotClosed ( ) ; if ( _browseCursor != null ) { try { msg = _browseCursor . next ( ) ; } catch ( SISessionDroppedException e ) { 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 ) { 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 ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIBrowserSession . tc , "next" , msg ) ; return msg ; } | Gets the next item from the BrowseCursor . |
161,969 | public void close ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIBrowserSession . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIBrowserSession . tc , "close" , this ) ; synchronized ( this ) { if ( ! _closed ) { _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 . |
161,970 | 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 . |
161,971 | 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 |
161,972 | 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 . |
161,973 | 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 |
161,974 | public static synchronized void initialise ( ) { if ( _instance == null ) { if ( _instance == null ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "We are NOT in Server mode" ) ; _instance = ClientCommsDiagnosticModule . getInstance ( ) ; } _instance . register ( packageList ) ; } } | Initialises the diagnostic module . |
161,975 | public void ffdcDumpDefault ( Throwable t , IncidentStream is , Object callerThis , Object [ ] objs , String sourceId ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "ffdcDumpDefault" , new Object [ ] { t , is , callerThis , objs , sourceId } ) ; super . ffdcDumpDefault ( t , is , callerThis , objs , sourceId ) ; is . writeLine ( "\n= ============= SIB Communications Diagnostic Information =============" , "" ) ; is . writeLine ( "Current Diagnostic Module: " , _instance ) ; dumpJFapClientStatus ( is ) ; dumpJFapServerStatus ( is ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "ffdcDumpDefault" ) ; } | Called when an FFDC is generated and the stack matches one of our packages . |
161,976 | boolean setObserver ( Observer observer ) { boolean success ; Observer oldObserver ; synchronized ( this ) { oldObserver = ivObserver ; success = oldObserver != null || ! isDone ( ) ; ivObserver = success ? observer : null ; } if ( oldObserver != null ) { oldObserver . update ( null , observer ) ; } return success ; } | Sets the current observer and updates the pending one . If the result is already available the existing observer if any will be updated and passed the new observer as data . Otherwise the observer will be updated when the result is available and will be passed null as data . |
161,977 | private void cleanup ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "cleanup" ) ; synchronized ( ivRemoteAsyncResultReaper ) { if ( ivAddedToReaper ) { this . ivRemoteAsyncResultReaper . remove ( this ) ; } else { unexportObject ( ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "cleanup" ) ; } | Clean up all resources associated with this object . |
161,978 | RemoteAsyncResult exportObject ( ) throws RemoteException { ivObjectID = ivRemoteRuntime . activateAsyncResult ( ( Servant ) createTie ( ) ) ; return ivRemoteRuntime . getAsyncResultReference ( ivObjectID ) ; } | Export this object so that it is remotely accessible . |
161,979 | protected void unexportObject ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unexportObject: " + this ) ; if ( ivObjectID != null ) { try { ivRemoteRuntime . deactivateAsyncResult ( ivObjectID ) ; } catch ( Throwable e ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unexportObject exception" , e ) ; FFDCFilter . processException ( e , CLASS_NAME + ".unexportObject" , "237" , this ) ; } this . ivObjectID = null ; } } | Unexport this object so that it is not remotely accessible . |
161,980 | public BeanId find ( EJSHome home , Serializable pkey , boolean isHome ) { int hashValue = BeanId . computeHashValue ( home . j2eeName , pkey , isHome ) ; BeanId [ ] buckets = this . ivBuckets ; BeanId element = buckets [ ( hashValue & 0x7FFFFFFF ) % buckets . length ] ; if ( element == null || ! element . equals ( home , pkey , isHome ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { ++ ivCacheFinds ; Tr . debug ( tc , "BeanId not found in BeanId Cache : " + ivCacheHits + " / " + ivCacheFinds ) ; } element = new BeanId ( home , pkey , isHome ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { ++ ivCacheFinds ; ++ ivCacheHits ; Tr . debug ( tc , "BeanId found in BeanId Cache : " + ivCacheHits + " / " + ivCacheFinds ) ; } } return element ; } | d156807 . 3 Begins |
161,981 | protected boolean needsToBeRefreshed ( DefaultFacelet facelet ) { if ( _refreshPeriod == NO_CACHE_DELAY ) { return true ; } if ( _refreshPeriod == INFINITE_DELAY ) { return false ; } long target = facelet . getCreateTime ( ) + _refreshPeriod ; if ( System . currentTimeMillis ( ) > target ) { URLConnection conn = null ; try { conn = facelet . getSource ( ) . openConnection ( ) ; long lastModified = ResourceLoaderUtils . getResourceLastModified ( conn ) ; return lastModified == 0 || lastModified > target ; } catch ( IOException e ) { throw new FaceletException ( "Error Checking Last Modified for " + facelet . getAlias ( ) , e ) ; } finally { if ( conn != null ) { try { InputStream is = conn . getInputStream ( ) ; if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } return false ; } | Template method for determining if the Facelet needs to be refreshed . |
161,982 | int getState ( ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "getState" ) ; int state ; if ( ! prefixDone ) { Pattern . Clause prefix = pattern . getPrefix ( ) ; if ( prefix == null || next >= prefix . items . length ) { Pattern . Clause suffix = pattern . getSuffix ( ) ; state = suffix == null ? FINAL_MANY : suffix == prefix ? FINAL_EXACT : SWITCH_TO_SUFFIX ; } else state = prefix . items [ next ] == Pattern . matchOne ? SKIP_ONE_PREFIX : PREFIX_CHARS ; } else { Pattern . Clause suffix = pattern . getSuffix ( ) ; state = ( next < 0 ) ? FINAL_MANY : suffix . items [ next ] == Pattern . matchOne ? SKIP_ONE_SUFFIX : SUFFIX_CHARS ; } if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "getState" , new Integer ( state ) ) ; return state ; } | Get the state of this Pattern ( which item is next to process |
161,983 | void advance ( ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "advance" ) ; if ( ! prefixDone ) { Pattern . Clause prefix = pattern . getPrefix ( ) ; if ( prefix == null || next >= prefix . items . length ) { Pattern . Clause suffix = pattern . getSuffix ( ) ; if ( suffix != null && suffix != prefix ) { prefixDone = true ; next = suffix . items . length - 1 ; } } else next ++ ; } else next -- ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "advance" ) ; } | Advance the state of this pattern |
161,984 | char [ ] getChars ( ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "getChars" ) ; char [ ] ans ; if ( prefixDone ) ans = ( char [ ] ) pattern . getSuffix ( ) . items [ next -- ] ; else ans = ( char [ ] ) pattern . getPrefix ( ) . items [ next ++ ] ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "getChars" , new String ( ans ) ) ; return ans ; } | Get the characters and advance ( assumes the pattern is in one of the CHARS states |
161,985 | public boolean matchMidClauses ( char [ ] chars , int start , int length ) { return pattern . matchMiddle ( chars , start , start + length ) ; } | Test whether the underlying pattern s mid clauses match a set of characters . |
161,986 | public String extractPropertyFromURI ( String propName , String uri ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "extractPropertyFromURI" , new Object [ ] { propName , uri } ) ; String result = null ; if ( uri != null ) { uri = uri . trim ( ) ; if ( ! uri . equals ( "" ) ) { String [ ] parts = splitOnNonEscapedChar ( uri , '?' , 2 ) ; if ( parts . length >= 2 ) { String nvps = parts [ 1 ] . trim ( ) ; if ( ! nvps . equals ( "" ) ) { String [ ] nvpArray = splitOnNonEscapedChar ( nvps , '&' , - 1 ) ; String propNameE = propName + "=" ; for ( int i = 0 ; i < nvpArray . length ; i ++ ) { String nvp = nvpArray [ i ] ; if ( nvp . startsWith ( propNameE ) ) { result = nvp . substring ( propNameE . length ( ) ) ; break ; } } } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "extractPropertyFromURI" , result ) ; return result ; } | Extract the value of the named property from URI . Find the named property in the name value pairs of the uri and return the value or null if the property is not present . |
161,987 | private String [ ] splitOnNonEscapedChar ( String inputStr , char splitChar , int expectedPartCount ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "splitOnNonEscapedChar" , new Object [ ] { inputStr , splitChar , expectedPartCount } ) ; String [ ] parts = null ; List < String > partsList = null ; int startPoint = 0 ; int tokenStart = 0 ; int splitCharIndex = 0 ; int partCount = 0 ; while ( ( splitCharIndex != - 1 ) && ( partCount != ( expectedPartCount - 1 ) ) ) { splitCharIndex = inputStr . indexOf ( splitChar , startPoint ) ; if ( ( splitCharIndex != - 1 ) && ! charIsEscaped ( inputStr , splitCharIndex ) ) { String nextPart = inputStr . substring ( tokenStart , splitCharIndex ) ; if ( expectedPartCount >= 2 ) { if ( parts == null ) parts = new String [ expectedPartCount ] ; parts [ partCount ] = nextPart ; } else { if ( partsList == null ) partsList = new ArrayList < String > ( 5 ) ; partsList . add ( nextPart ) ; } partCount ++ ; startPoint = splitCharIndex + 1 ; tokenStart = startPoint ; } else { startPoint = splitCharIndex + 1 ; } } String nextPart = inputStr . substring ( tokenStart , inputStr . length ( ) ) ; if ( expectedPartCount >= 2 ) { if ( parts == null ) { parts = new String [ 1 ] ; } parts [ partCount ] = nextPart ; } else { if ( partsList == null ) { parts = new String [ 1 ] ; parts [ 0 ] = nextPart ; } else { partsList . add ( nextPart ) ; parts = partsList . toArray ( new String [ ] { } ) ; } } if ( ( parts [ parts . length - 1 ] == null ) ) { int lastValidEntry = 0 ; while ( ( parts [ lastValidEntry ] != null ) && ( ! "" . equals ( parts [ lastValidEntry ] ) ) ) { lastValidEntry ++ ; } String [ ] tempParts = new String [ lastValidEntry ] ; System . arraycopy ( parts , 0 , tempParts , 0 , lastValidEntry ) ; parts = tempParts ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "splitOnNonEscapedChar" , parts ) ; return parts ; } | Split the specified string into the requested number of pieces using the splitter character provided . This method is careful to only split on non - escaped instances of the splitter character . |
161,988 | private String unescape ( String input , char c ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unescape" , new Object [ ] { input , c } ) ; String result = input ; if ( input . indexOf ( c ) != - 1 ) { int startValue = 0 ; StringBuffer temp = new StringBuffer ( input ) ; String cStr = new String ( new char [ ] { c } ) ; while ( ( startValue = temp . indexOf ( cStr , startValue ) ) != - 1 ) { if ( startValue > 0 && temp . charAt ( startValue - 1 ) == '\\' ) { temp . deleteCharAt ( startValue - 1 ) ; } else { startValue ++ ; } } result = temp . toString ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "unescape" , result ) ; return result ; } | Remove \ characters from input String when they precede specified character . |
161,989 | private String unescapeBackslash ( String input ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unescapeBackslash" , input ) ; String result = input ; if ( input . indexOf ( "\\" ) != - 1 ) { int startValue = 0 ; StringBuffer tmp = new StringBuffer ( input ) ; while ( ( startValue = tmp . indexOf ( "\\" , startValue ) ) != - 1 ) { if ( startValue + 1 < tmp . length ( ) && tmp . charAt ( startValue + 1 ) == '\\' ) { tmp . deleteCharAt ( startValue ) ; startValue ++ ; } else { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "BAD_ESCAPE_CHAR_CWSIA0387" , new Object [ ] { input } , tc ) ; } } result = tmp . toString ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "unescapeBackslash" , result ) ; return result ; } | Convert escaped backslash to single backslash . This method de - escapes double backslashes whilst at the same time checking that there are no single backslahes in the input string . |
161,990 | private String [ ] validateNVP ( String namePart , String valuePart , String uri , JmsDestination dest ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "validateNVP" , new Object [ ] { namePart , valuePart , uri , dest } ) ; if ( valuePart . indexOf ( '&' ) != - 1 ) { valuePart = valuePart . replaceAll ( "\\\\&" , "&" ) ; } valuePart = unescapeBackslash ( valuePart ) ; if ( namePart . equalsIgnoreCase ( MA88_EXPIRY ) ) { namePart = JmsInternalConstants . TIME_TO_LIVE ; } if ( namePart . equalsIgnoreCase ( MA88_PERSISTENCE ) ) { namePart = JmsInternalConstants . DELIVERY_MODE ; if ( valuePart . equals ( "1" ) ) { valuePart = ApiJmsConstants . DELIVERY_MODE_NONPERSISTENT ; } else if ( valuePart . equals ( "2" ) ) { valuePart = ApiJmsConstants . DELIVERY_MODE_PERSISTENT ; } else { valuePart = ApiJmsConstants . DELIVERY_MODE_APP ; } } String [ ] result = new String [ ] { namePart , valuePart } ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "validateNVP" , result ) ; return result ; } | This utility method performs the validation on the name and value parts of the NVP . It performs several checks to make sure that neither part contain any illegal characters unless they are escaped by a backslash . |
161,991 | private void configureDestinationFromMap ( JmsDestination dest , Map < String , String > props , String uri ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "configureDestinationFromMap" , new Object [ ] { dest , props , uri } ) ; Iterator < Map . Entry < String , String > > iter = props . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Map . Entry < String , String > nextProp = iter . next ( ) ; String namePart = nextProp . getKey ( ) ; String valuePart = nextProp . getValue ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "name " + namePart + ", value " + valuePart ) ; boolean propertyIsSettable = true ; Class cl = MsgDestEncodingUtilsImpl . getPropertyType ( namePart ) ; if ( cl == null ) { propertyIsSettable = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Ignoring invalid property " + namePart ) ; } if ( propertyIsSettable ) { try { Object valueObject = MsgDestEncodingUtilsImpl . convertPropertyToType ( namePart , valuePart ) ; if ( namePart . equals ( TOPIC_NAME ) ) { if ( dest instanceof JmsTopicImpl ) { ( ( JmsTopicImpl ) dest ) . setTopicName ( ( String ) valueObject ) ; } else { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INTERNAL_ERROR_CWSIA0386" , null , tc ) ; } } else { MsgDestEncodingUtilsImpl . setDestinationProperty ( dest , namePart , valueObject ) ; } } catch ( NumberFormatException nfe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exception ( tc , nfe ) ; throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INVALID_URI_ELEMENT_CWSIA0384" , new Object [ ] { namePart , valuePart , uri } , nfe , null , null , tc ) ; } catch ( JMSException jmse ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exception ( tc , jmse ) ; throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INVALID_URI_ELEMENT_CWSIA0384" , new Object [ ] { namePart , valuePart , uri } , tc ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "configureDestinationFromMap" ) ; } | This utililty method uses the supplied Map to configure a destination property . The map contains the name and value pairs from the URI . |
161,992 | public Destination createDestinationFromURI ( String uri , int qmProcessing ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createDestinationFromURI" , new Object [ ] { uri , qmProcessing } ) ; Destination result = null ; if ( uri != null ) { result = processURI ( uri , qmProcessing , null ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createDestinationFromURI" , result ) ; return result ; } | Create a Destination object from a full URI format String . |
161,993 | private static boolean charIsEscaped ( String str , int index ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "charIsEscaped" , new Object [ ] { str , index } ) ; if ( str == null || index < 0 || index >= str . length ( ) ) return false ; int nEscape = 0 ; int i = index - 1 ; while ( i >= 0 && str . charAt ( i ) == '\\' ) { nEscape ++ ; i -- ; } boolean result = nEscape % 2 == 1 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "charIsEscaped" , result ) ; return result ; } | Test if the specified character is escaped . Checks whether the character at the specified index is preceded by an escape character . The test is non - trivial because it has to check that the escape character is itself non - escaped . |
161,994 | public static PrivateKey readPrivateKey ( String pemResName ) throws Exception { InputStream contentIS = TokenUtils . class . getResourceAsStream ( pemResName ) ; byte [ ] tmp = new byte [ 4096 ] ; int length = contentIS . read ( tmp ) ; PrivateKey privateKey = decodePrivateKey ( new String ( tmp , 0 , length ) ) ; return privateKey ; } | Read a PEM encoded private key from the classpath |
161,995 | public static PublicKey readPublicKey ( String pemResName ) throws Exception { InputStream contentIS = TokenUtils . class . getResourceAsStream ( pemResName ) ; byte [ ] tmp = new byte [ 4096 ] ; int length = contentIS . read ( tmp ) ; PublicKey publicKey = decodePublicKey ( new String ( tmp , 0 , length ) ) ; return publicKey ; } | Read a PEM encoded public key from the classpath |
161,996 | public static KeyPair generateKeyPair ( int keySize ) throws NoSuchAlgorithmException { KeyPairGenerator keyPairGenerator = KeyPairGenerator . getInstance ( "RSA" ) ; keyPairGenerator . initialize ( keySize ) ; KeyPair keyPair = keyPairGenerator . genKeyPair ( ) ; return keyPair ; } | Generate a new RSA keypair . |
161,997 | public static PrivateKey decodePrivateKey ( String pemEncoded ) throws Exception { pemEncoded = removeBeginEnd ( pemEncoded ) ; byte [ ] pkcs8EncodedBytes = Base64 . getDecoder ( ) . decode ( pemEncoded ) ; PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec ( pkcs8EncodedBytes ) ; KeyFactory kf = KeyFactory . getInstance ( "RSA" ) ; PrivateKey privKey = kf . generatePrivate ( keySpec ) ; return privKey ; } | Decode a PEM encoded private key string to an RSA PrivateKey |
161,998 | public static PublicKey decodePublicKey ( String pemEncoded ) throws Exception { pemEncoded = removeBeginEnd ( pemEncoded ) ; byte [ ] encodedBytes = Base64 . getDecoder ( ) . decode ( pemEncoded ) ; X509EncodedKeySpec spec = new X509EncodedKeySpec ( encodedBytes ) ; KeyFactory kf = KeyFactory . getInstance ( "RSA" ) ; return kf . generatePublic ( spec ) ; } | Decode a PEM encoded public key string to an RSA PublicKey |
161,999 | public void registerDeferredService ( BundleContext bundleContext , Class < ? > providedService , Dictionary dict ) { Object obj = serviceReg . get ( ) ; if ( obj instanceof ServiceRegistration < ? > ) { return ; } if ( obj instanceof CountDownLatch ) { try { ( ( CountDownLatch ) obj ) . await ( ) ; if ( serviceReg . get ( ) instanceof ServiceRegistration < ? > ) { return ; } } catch ( InterruptedException swallowed ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Count down interrrupted" , swallowed ) ; } } } else { CountDownLatch latch = new CountDownLatch ( 1 ) ; if ( serviceReg . compareAndSet ( null , latch ) ) { try { serviceReg . set ( bundleContext . registerService ( providedService . getName ( ) , this , dict ) ) ; return ; } finally { serviceReg . compareAndSet ( latch , null ) ; latch . countDown ( ) ; } } } registerDeferredService ( bundleContext , providedService , dict ) ; } | Register information available after class loader is created for use by RAR bundle |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.