idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
36,400
public int getRequiredRemoteBusinessInterfaceIndex ( String interfaceName ) throws IllegalStateException { int interfaceIndex = getRemoteBusinessInterfaceIndex ( interfaceName ) ; if ( interfaceIndex == - 1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getRequiredRemoteBusinessInterfaceIndex : IllegalStateException : " + "Requested business interface not found : " + interfaceName ) ; throw new IllegalStateException ( "Requested business interface not found : " + interfaceName ) ; } return interfaceIndex ; }
Gets the index of the remote busines interface . This method will throw an IllegalStateException if a remte interface could not be matched . If it is known that a match must occur on a remote business interface then this method should be used .
36,401
public String [ ] [ ] getMethodLevelCustomFinderMethodSignatures ( String cfprocessstring ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getMethodLevelCustomFinderMethodSignatures:" + cfprocessstring ) ; StringTokenizer st = new StringTokenizer ( cfprocessstring , ":" ) ; String cfMethodSignatureArray [ ] [ ] = new String [ st . countTokens ( ) ] [ 2 ] ; int methodCounter = 0 ; while ( st . hasMoreTokens ( ) ) { String methodSignature = st . nextToken ( ) ; StringTokenizer methodSignaturest = new StringTokenizer ( methodSignature , "()" ) ; try { cfMethodSignatureArray [ methodCounter ] [ CF_METHOD_NAME_OFFSET ] = methodSignaturest . nextToken ( ) ; if ( methodSignature . equals ( "()" ) ) { cfMethodSignatureArray [ methodCounter ] [ CF_METHOD_SIG_OFFSET ] = null ; } else { cfMethodSignatureArray [ methodCounter ] [ CF_METHOD_SIG_OFFSET ] = methodSignaturest . nextToken ( ) ; } } catch ( java . util . NoSuchElementException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) && methodSignature != null ) Tr . debug ( tc , "Processing offset [" + methodCounter + "] " + methodSignature + " failed, incorrect format" ) ; } methodCounter ++ ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getMethodLevelCustomFinderMethodSignatures: " + cfMethodSignatureArray ) ; return cfMethodSignatureArray ; }
d112604 . 1
36,402
public JsMessage transcribeToJmf ( ) throws MessageCopyFailedException , IncorrectMessageTypeException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "transcribeToJmf" ) ; JsMsgObject newJmo = null ; try { if ( this instanceof JsJmsMessageImpl ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Transcribing from JsJmsMessageImpl" ) ; newJmo = jmo . transcribeToJmf ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Non-JMS Messages are not yet supported" ) ; String exString = nls . getFormattedMessage ( "UNEXPECTED_MESSAGE_TYPE_CWSIF0102" , new Object [ ] { getJsMessageType ( ) , MessageType . JMS } , "The Message can not be represented as a pure JMF Message" ) ; throw new IncorrectMessageTypeException ( exString ) ; } } catch ( MFPUnsupportedEncodingRuntimeException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.impl.JsMessageImpl.transcribeToJmf" , "721" ) ; throw ( UnsupportedEncodingException ) e . getCause ( ) ; } JsMessage newMsg ; if ( newJmo != this . jmo ) { newMsg = createNewGeneralized ( newJmo ) ; } else { newMsg = this ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "transcribeToJmf" , newMsg ) ; return newMsg ; }
Transcribe this message to pure JMF
36,403
public int getApproximateLength ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getApproximateLength" ) ; if ( approxLength == - 1 ) approxLength = guessApproxLength ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getApproximateLength" , Integer . valueOf ( approxLength ) ) ; return approxLength ; }
Return an approximate size for the flattened message . It is important that this method is quick and cheap rather than highly accurate .
36,404
private final JsMessageImpl createNew ( ) throws MessageCopyFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createNew" ) ; JsMessageImpl newMsg = null ; Class msgClass = this . getClass ( ) ; try { newMsg = ( JsMessageImpl ) msgClass . newInstance ( ) ; copyTransients ( newMsg ) ; JsMsgObject newJmo = jmo . getCopy ( ) ; newMsg . setJmo ( newJmo ) ; } catch ( IllegalAccessException e1 ) { FFDCFilter . processException ( e1 , "com.ibm.ws.sib.mfp.impl.JsMessageImpl.createNew" , "jsm1600" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "IllegalAccessException " + e1 . getMessage ( ) + " instantiating class " + msgClass . getName ( ) ) ; throw new MessageCopyFailedException ( e1 ) ; } catch ( InstantiationException e2 ) { FFDCFilter . processException ( e2 , "com.ibm.ws.sib.mfp.impl.JsMessageImpl.createNew" , "jsm1610" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "InstantiationException " + e2 . getMessage ( ) + " instantiating class " + msgClass . getName ( ) ) ; throw new MessageCopyFailedException ( e2 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createNew" , newMsg ) ; return newMsg ; }
Return a new Jsmessage of the same specialization as this containing the given JsMsgObject .
36,405
private final JsMessageImpl createNewGeneralized ( JsMsgObject newJmo ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createNewGeneralized" ) ; JsMessageImpl newMsg = null ; newMsg = new JsMessageImpl ( newJmo ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createNewGeneralized" , newMsg ) ; return newMsg ; }
Return a new JsMessage generalizing the message to just be a JsMessageImpl . The new message contains the given JsMsgObject .
36,406
@ SuppressWarnings ( "rawtypes" ) public static Hashtable parsePostData ( ServletInputStream in , String encoding , boolean multireadPropertyEnabled ) throws IOException { int inputLen ; byte [ ] postedBytes = null ; String postedBody ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "parsePostData" , "parsing chunked post data. encoding = " + encoding ) ; if ( in == null ) throw new IllegalArgumentException ( "post data inputstream is null" ) ; try { ByteArrayOutputStream byteOS = new ByteArrayOutputStream ( DEFAULT_BUFFER_SIZE ) ; do { byte [ ] readInBytes = new byte [ DEFAULT_BUFFER_SIZE ] ; inputLen = in . read ( readInBytes , 0 , DEFAULT_BUFFER_SIZE ) ; if ( inputLen > 0 ) { byteOS . write ( readInBytes , 0 , inputLen ) ; } } while ( inputLen != - 1 ) ; if ( multireadPropertyEnabled ) { in . close ( ) ; } postedBytes = byteOS . toByteArray ( ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "parsePostData" , "finished reading [" + postedBytes . length + "] bytes" ) ; } catch ( IOException e ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( e , "com.ibm.ws.webcontainer.servlet.RequestUtils.parsePostData" , "598" ) ; throw e ; } try { postedBody = new String ( postedBytes , encoding ) ; } catch ( UnsupportedEncodingException e ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( e , "com.ibm.ws.webcontainer.servlet.RequestUtils.parsePostData" , "618" ) ; postedBody = new String ( postedBytes ) ; } if ( WCCustomProperties . PARSE_UTF8_POST_DATA && encoding . equalsIgnoreCase ( "UTF-8" ) ) { for ( byte nextByte : postedBytes ) { if ( nextByte < ( byte ) 0 ) { encoding = "8859_1" ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "parsePostData" , "UTF8 post data, set encoing to 8859_1 to prevent futrther encoding" ) ; break ; } } } return parseQueryString ( postedBody , encoding ) ; }
begin 231634 Support posts with query parms in chunked body WAS . webcontainer
36,407
public final Item findOldestItem ( ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findOldestItem" ) ; ItemCollection ic = ( ( ItemCollection ) _getMembership ( ) ) ; if ( null == ic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findOldestItem" ) ; throw new NotInMessageStore ( ) ; } Item item = null ; if ( ic != null ) { item = ( Item ) ic . findOldestItem ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findOldestItem" , item ) ; return item ; }
Find the item that has been known to the stream for longest . The item returned may be in any of the states defined in the state model . The caller should not assume that the item can be used for any particular purpose .
36,408
protected void abort ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Aborting connection" ) ; } this . aborted = true ; }
Abort this context to trigger immediate exceptions on future IO requests .
36,409
protected void setTimeoutTime ( int time ) { int timeout = time ; if ( timeout == TCPRequestContext . NO_TIMEOUT ) { this . timeoutTime = TCPRequestContext . NO_TIMEOUT ; this . timeoutInterval = 0 ; } else { if ( timeout == TCPRequestContext . USE_CHANNEL_TIMEOUT ) { timeout = getConfig ( ) . getInactivityTimeout ( ) ; } if ( timeout != ValidateUtils . INACTIVITY_TIMEOUT_NO_TIMEOUT ) { this . timeoutTime = System . currentTimeMillis ( ) + timeout ; this . timeoutInterval = timeout ; } else { this . timeoutTime = TCPRequestContext . NO_TIMEOUT ; this . timeoutInterval = 0 ; } } }
Sets the timeout value returned by getTimeoutTime .
36,410
public boolean updateIOCounts ( long byteCount , int type ) { setLastIOAmt ( byteCount ) ; setIODoneAmount ( getIODoneAmount ( ) + byteCount ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { String dbString = null ; if ( type == 0 ) { dbString = "Read " ; } else { dbString = "Wrote " ; } SocketIOChannel channel = getTCPConnLink ( ) . getSocketIOChannel ( ) ; Tr . event ( tc , dbString + byteCount + "(" + + getIODoneAmount ( ) + ")" + " bytes, " + getIOAmount ( ) + " requested on local: " + channel . getSocket ( ) . getLocalSocketAddress ( ) + " remote: " + channel . getSocket ( ) . getRemoteSocketAddress ( ) ) ; } boolean rc ; if ( getIODoneAmount ( ) >= getIOAmount ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( type == 0 ) { Tr . debug ( tc , "read complete, at least minimum amount of data read" ) ; } else { Tr . debug ( tc , "write complete, at least minimum amount of data written" ) ; } } rc = true ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( type == 0 ) { Tr . debug ( tc , "read not complete, more data needed" ) ; } else { Tr . debug ( tc , "write not complete, more data needs to be written" ) ; } } rc = false ; } return rc ; }
rather than in extension classes
36,411
public ConversationReceiveListener acceptConnection ( Conversation cfConversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "acceptConnection" , cfConversation ) ; synchronized ( activeConversations ) { Object connectionReference = cfConversation . getConnectionReference ( ) ; ArrayList list = ( ArrayList ) activeConversations . get ( connectionReference ) ; if ( list == null ) { list = new ArrayList ( ) ; activeConversations . put ( connectionReference , list ) ; } else { ArrayList removeList = new ArrayList ( ) ; for ( int x = 0 ; x < list . size ( ) ; x ++ ) { Conversation conv = ( Conversation ) list . get ( x ) ; if ( conv . isClosed ( ) ) { removeList . add ( conv ) ; } } for ( int x = 0 ; x < removeList . size ( ) ; x ++ ) { list . remove ( removeList . get ( x ) ) ; } } list . add ( cfConversation ) ; if ( cfConversation . getConnectionClosedListener ( ConversationUsageType . JFAP ) == null ) { cfConversation . addConnectionClosedListener ( this , ConversationUsageType . JFAP ) ; } } if ( cfConversation . getAttachment ( ) == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Creating conversation state" ) ; cfConversation . setAttachment ( new ConversationState ( ) ) ; } if ( cfConversation . getLinkLevelAttachment ( ) == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Creating link level state" ) ; cfConversation . setLinkLevelAttachment ( new ServerLinkLevelState ( ) ) ; } cfConversation . setConversationType ( Conversation . CLIENT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "acceptConnection" , serverTransportReceiveListener ) ; return serverTransportReceiveListener ; }
Called when we are about to accept a connection from a peer .
36,412
public void removeConversation ( Conversation conv ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeConversation" , conv ) ; synchronized ( activeConversations ) { Object connectionReference = conv . getConnectionReference ( ) ; ArrayList list = ( ArrayList ) activeConversations . get ( connectionReference ) ; if ( list != null ) { list . remove ( conv ) ; if ( list . size ( ) == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "List is now empty, removing connection object" ) ; activeConversations . remove ( connectionReference ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeConversation" ) ; }
This method removes a conversation from the list of active conversations . This would be called if the connection is closed or if a failure is deteceted .
36,413
public void connectionClosed ( Object connectionReference ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "connectionClosed" , connectionReference ) ; removeAllConversations ( connectionReference ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "connectionClosed" ) ; }
Driven in the event that the underlying connection closes . This will only be driven if the socket dies before a connection to the ME has had chance to be established .
36,414
public void removeAllConversations ( Object connectionReference ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeAllConversations" , connectionReference ) ; final ArrayList list ; synchronized ( activeConversations ) { list = ( ArrayList ) activeConversations . remove ( connectionReference ) ; } if ( list != null ) { try { for ( int x = 0 ; x < list . size ( ) ; x ++ ) { Conversation conv = ( Conversation ) list . get ( x ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Found a Conversation in the table: " , conv ) ; serverTransportReceiveListener . cleanupConnection ( conv ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".removeAllConversations" , CommsConstants . SERVERTRANSPORTACCEPTLISTENER_REMOVEALL_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Caught an exception cleaning up a connection" , t ) ; } list . clear ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeAllConversations" ) ; }
This method is used to clean up any resources that
36,415
protected final ObjectFactoryInfo getObjectFactoryInfo ( Class < ? > klass , String className ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getObjectFactory: " + klass + ", " + className ) ; if ( ivObjectFactoryMap == null ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getObjectFactory: no factories" ) ; return null ; } if ( klass != null && klass != Object . class ) { ObjectFactoryInfo result = ivObjectFactoryMap . get ( klass ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getObjectFactory: " + result ) ; return result ; } if ( ivObjectFactoryByNameMap == null ) { ivObjectFactoryByNameMap = new HashMap < String , ObjectFactoryInfo > ( ) ; for ( Map . Entry < Class < ? > , ObjectFactoryInfo > entry : ivObjectFactoryMap . entrySet ( ) ) { ivObjectFactoryByNameMap . put ( entry . getKey ( ) . getName ( ) , entry . getValue ( ) ) ; } } ObjectFactoryInfo result = ivObjectFactoryByNameMap . get ( className ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getObjectFactory (by-name): " + result ) ; return result ; }
Gets an object factory for the specified class or class name . This method must be used to support configurations without a class loader .
36,416
private void updateInjectionBinding ( String jndiName , InjectionBinding < A > injectionBinding ) { if ( ! jndiName . equals ( injectionBinding . getJndiName ( ) ) ) { injectionBinding . setJndiName ( jndiName ) ; } }
Updates an InjectionBinding created for an annotation .
36,417
private < P extends Annotation > InjectionBinding < ? > addOrMergeOverrideInjectionBinding ( Class < ? > instanceClass , Member member , A annotation , String jndiName ) throws InjectionException { @ SuppressWarnings ( "unchecked" ) InjectionProcessor < P , ? > processor = ( InjectionProcessor < P , ? > ) ivOverrideProcessor ; if ( processor != null ) { InjectionBinding < P > injectionBinding = processor . getInjectionBindingForAnnotation ( jndiName ) ; @ SuppressWarnings ( "unchecked" ) OverrideInjectionProcessor < P , A > overrideProcessor = ( OverrideInjectionProcessor < P , A > ) processor ; if ( injectionBinding == null ) { injectionBinding = overrideProcessor . createOverrideInjectionBinding ( instanceClass , member , annotation , jndiName ) ; if ( injectionBinding != null ) { processor . updateInjectionBinding ( jndiName , injectionBinding ) ; processor . addInjectionBinding ( injectionBinding ) ; return injectionBinding ; } } else { overrideProcessor . mergeOverrideInjectionBinding ( instanceClass , member , annotation , injectionBinding ) ; return injectionBinding ; } } return null ; }
Creates and adds a new override injection binding or merges the data in an annotation with an existing override injection binding .
36,418
void performJavaNameSpaceBinding ( ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "performJavaNameSpaceBinding: " + this ) ; for ( InjectionBinding < A > injectionBinding : ivAllAnnotationsCollection . values ( ) ) { if ( injectionBinding . getInjectionScope ( ) == InjectionScope . COMP || ivContext . ivBindNonCompInjectionBindings ) { if ( injectionBinding . getBindingObject ( ) == null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "skipping empty " + injectionBinding ) ; } else { injectionBinding . bindInjectedObject ( ) ; } } else { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . debug ( tc , "skipping non-java:comp " + injectionBinding . toSimpleString ( ) ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "performJavaNameSpaceBinding" ) ; }
Bind all the jndi annotation entries found .
36,419
public final void addInjectionBinding ( InjectionBinding < A > injectionBinding ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addInjectionBinding: " + injectionBinding ) ; ivAllAnnotationsCollection . put ( injectionBinding . getJndiName ( ) , injectionBinding ) ; }
Add the InjectionBinding to the annotationCollection . The collection will be used later when binding and resolving injection targets .
36,420
protected final String getJavaBeansPropertyName ( Member fieldOrMethod ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getJavaBeansPropertyName : " + fieldOrMethod ) ; String propertyName ; if ( fieldOrMethod instanceof Field ) { Field field = ( Field ) fieldOrMethod ; propertyName = field . getName ( ) ; } else { Method method = ( Method ) fieldOrMethod ; String name = method . getName ( ) ; if ( name . startsWith ( "set" ) && name . length ( ) > 3 && Character . isUpperCase ( name . charAt ( 3 ) ) ) { propertyName = Character . toLowerCase ( name . charAt ( 3 ) ) + ( name . length ( ) > 4 ? name . substring ( 4 ) : "" ) ; } else { propertyName = null ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getJavaBeansPropertyName : " + propertyName ) ; return propertyName ; }
F50309 . 5
36,421
public Set < String > getServerFeatures ( ) { ServerTask serverTask = runningServer . get ( ) ; try { if ( serverTask != null ) return serverTask . getServerFeatures ( ) ; } catch ( InterruptedException e ) { } return Collections . emptySet ( ) ; }
The feature gather operation needs to launch the server far enough for it to read config and figure out all of the features that would be loaded . It doesn t actually start any of those features but it needs to get far enough to evaluate the full feature set including features and auto - features that are part of Liberty or are provided by product extensions .
36,422
protected Node findNode ( int nodeStreamID ) { if ( nodeStreamID == this . streamID ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "findNode exit: bottom of recursion, found node: " + this ) ; } return this ; } else { Iterator < Node > iter = dependents . iterator ( ) ; Node found = null ; while ( iter . hasNext ( ) ) { found = iter . next ( ) . findNode ( nodeStreamID ) ; if ( found != null ) { return found ; } } return null ; } }
Starting with this node find the node matching the input stream ID look at this node and all dependents recursively . To search the whole tree start by calling findNode on the root node .
36,423
protected void addDependent ( Node nodeToAdd ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addDependent entry: node to add: " + nodeToAdd ) ; } dependents . add ( nodeToAdd ) ; }
Add a new dependent to this node .
36,424
protected void removeDependent ( Node nodeToRemove ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "removeDependent entry: node to remove: " + nodeToRemove ) ; } dependents . remove ( nodeToRemove ) ; }
Remove a dependent from the dependent list this node is keeping
36,425
protected void clearDependentsWriteCount ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "clearDependentsWriteCount entry: for this node: " + this ) ; } dependentWriteCount = 0 ; if ( ( dependents == null ) || ( dependents . size ( ) == 0 ) ) { return ; } for ( int i = 0 ; i < dependents . size ( ) ; i ++ ) { dependents . get ( i ) . setWriteCount ( 0 ) ; } }
clear counts for all direct dependents of this node . also clear the dependent write counter
36,426
protected Node findNextWrite ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "findNextWrite entry: on node " + this + "With status: " + status + "and positive ratio of: " + getPriorityRatioPositive ( ) ) ; } if ( status == NODE_STATUS . REQUESTING_WRITE ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "findNextWrite exit: node to write next is: " + this . toStringDetails ( ) ) ; } return this ; } else { for ( int i = 0 ; i < dependents . size ( ) ; i ++ ) { Node n = dependents . get ( i ) ; Node nextWrite = n . findNextWrite ( ) ; if ( nextWrite != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "findNextWrite exit: next write node found. stream-id: " + nextWrite . getStreamID ( ) + " node hc: " + nextWrite . hashCode ( ) ) ; } return nextWrite ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "findNextWrite exit: null" ) ; } return null ; } }
recursively go through the tree finding the highest priority node that is requesting to write .
36,427
protected int incrementDependentWriteCount ( ) { dependentWriteCount ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "incrementDependentWriteCount entry: new dependentWriteCount of: " + dependentWriteCount + " for node: " + this ) ; } return dependentWriteCount ; }
increment the count since of the number of writes the direct dependents have done since that last reset .
36,428
protected void setParent ( Node newParent , boolean removeDep ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setParent entry: new parent will be: " + newParent + " for node: " + this ) ; } Node oldParent = parent ; parent = newParent ; if ( newParent != null ) { parent . addDependent ( this ) ; } if ( removeDep ) { if ( oldParent != null ) { if ( newParent == null ) { oldParent . removeDependent ( this ) ; } else if ( oldParent . getStreamID ( ) != parent . getStreamID ( ) ) { oldParent . removeDependent ( this ) ; } } } }
Give this node a new parent . Remove this node as a dependent of the old parent Add this node as a dependent of the new parent .
36,429
private final AbstractItemLink _next ( long lockID ) throws SevereMessageStoreException { AbstractItemLink lockedMatchingLink = null ; if ( _jumpbackEnabled ) { while ( null == lockedMatchingLink ) { AbstractItemLink link ; synchronized ( this ) { link = _behindList . getFirst ( true ) ; } if ( link == null ) { break ; } else if ( link . lockItemIfAvailable ( lockID ) ) { lockedMatchingLink = link ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "using available: " + lockedMatchingLink ) ; } } } if ( null == lockedMatchingLink ) { AbstractItemLink lookAtLink ; synchronized ( this ) { lookAtLink = ( AbstractItemLink ) advance ( ) ; } while ( null != lookAtLink && null == lockedMatchingLink ) { long pos = lookAtLink . getPosition ( ) ; synchronized ( this ) { if ( pos > _highestPosition ) { _highestPosition = pos ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "examine " + lookAtLink + "(seq = " + _highestPosition + ")" ) ; } } if ( lookAtLink . lockIfMatches ( _filter , lockID ) ) { lockedMatchingLink = lookAtLink ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "found: " + lockedMatchingLink ) ; } else { synchronized ( this ) { lookAtLink = ( AbstractItemLink ) advance ( ) ; } } } } return lockedMatchingLink ; }
Finds and locks the next matching item .
36,430
public final void available ( AbstractItemLink link ) throws SevereMessageStoreException { if ( _jumpbackEnabled ) { final long newPos = link . getPosition ( ) ; synchronized ( this ) { if ( newPos <= _highestPosition ) { if ( null != link . matches ( _filter ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "availableLink adding: " + link ) ; _behindList . insert ( link ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "availableLink does not match: " + link ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "availableLink seq(" + newPos + ") too large (" + _highestPosition + ")" ) ; } } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "available link - jumpbackDisabled: " + link ) ; } }
The cursor is being told that a link has become available . Add it to the list to revisit but only if it is older than the current cursor position .
36,431
public final AbstractItem next ( long lockID ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "next" , Long . valueOf ( lockID ) ) ; final AbstractItemLink lockedMatchingLink = _next ( lockID ) ; AbstractItem lockedMatchingItem = null ; if ( null != lockedMatchingLink ) { lockedMatchingItem = lockedMatchingLink . getItem ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "next" , lockedMatchingItem ) ; return lockedMatchingItem ; }
Return the next item that is deemed a match by the filter specified when the cursor was created . Items returned by this method are locked .
36,432
public final void finished ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "finished" ) ; if ( null != _lastLink ) { _lastLink . cursorRemoved ( ) ; _lastLink = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "finished" ) ; }
Signals that use of the cursor has finished . The cursor is removed from the AIL that it currently rests on .
36,433
private void callTransactionalLifecycleInterceptors ( InterceptorProxy [ ] proxies , int methodId ) throws RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; LifecycleInterceptorWrapper wrapper = new LifecycleInterceptorWrapper ( container , this ) ; EJSDeployedSupport s = new EJSDeployedSupport ( ) ; s . ivIgnoreApplicationExceptions = true ; try { container . preInvokeForLifecycleInterceptors ( wrapper , methodId , s , this ) ; if ( isTraceOn ) { if ( TEBeanLifeCycleInfo . isTraceEnabled ( ) ) TEBeanLifeCycleInfo . traceEJBCallEntry ( LifecycleInterceptorWrapper . TRACE_NAMES [ methodId ] ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "callLifecycleInterceptors" ) ; } InvocationContextImpl < ? > inv = getInvocationContext ( ) ; BeanMetaData bmd = home . beanMetaData ; inv . doLifeCycle ( proxies , bmd . _moduleMetaData ) ; } catch ( Throwable t ) { s . setUncheckedLocalException ( t ) ; } finally { if ( isTraceOn && TEBeanLifeCycleInfo . isTraceEnabled ( ) ) { TEBeanLifeCycleInfo . traceEJBCallExit ( LifecycleInterceptorWrapper . TRACE_NAMES [ methodId ] ) ; } container . postInvokeForLifecycleInterceptors ( wrapper , methodId , s ) ; } }
Invoke PostConstruct or PreDestroy interceptors associated with this bean using the transaction and security context specified in the method info .
36,434
public void postInvoke ( int id , EJSDeployedSupport s ) throws RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "postInvoke" ) ; } if ( ivContainerManagedConcurrency && s . ivLockAcquired ) { EJBMethodInfoImpl mInfo = s . methodInfo ; LockType lockType = mInfo . ivLockType ; if ( lockType == LockType . READ ) { ivReadLock . unlock ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "postInvoke released read lock: " + ivLock . toString ( ) ) ; } } else { ivWriteLock . unlock ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "postInvoke released write lock: " + ivLock . toString ( ) ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "postInvoke" ) ; } }
Release lock acquired by preInvoke .
36,435
private Class < ? > resolveClassWithCL ( String name ) throws ClassNotFoundException { SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { return Class . forName ( name , false , getClassLoader ( thisClass ) ) ; } return Class . forName ( name , false , platformClassloader ) ; }
Resolves a class using the appropriate classloader .
36,436
protected Class < ? > resolveProxyClass ( String [ ] interfaceNames ) throws ClassNotFoundException { ClassLoader proxyClassLoader = classLoader ; Class < ? > [ ] interfaces = new Class [ interfaceNames . length ] ; Class < ? > nonPublicInterface = null ; for ( int i = 0 ; i < interfaceNames . length ; i ++ ) { Class < ? > intf = loadClass ( interfaceNames [ i ] ) ; if ( ! Modifier . isPublic ( intf . getModifiers ( ) ) ) { ClassLoader classLoader = getClassLoader ( intf ) ; if ( nonPublicInterface != null ) { if ( classLoader != proxyClassLoader ) { throw new IllegalAccessError ( nonPublicInterface + " and " + intf + " both declared non-public in different class loaders" ) ; } } else { nonPublicInterface = intf ; proxyClassLoader = classLoader ; } } interfaces [ i ] = intf ; } try { return Proxy . getProxyClass ( proxyClassLoader , interfaces ) ; } catch ( IllegalArgumentException ex ) { throw new ClassNotFoundException ( null , ex ) ; } }
Delegates class loading to the specified class loader .
36,437
private static ClassLoader getPlatformClassLoader ( ) { if ( JavaInfo . majorVersion ( ) >= 9 ) { return AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { public ClassLoader run ( ) { ClassLoader pcl = null ; try { Method getPlatformClassLoader = ClassLoader . class . getMethod ( "getPlatformClassLoader" ) ; pcl = ( ClassLoader ) getPlatformClassLoader . invoke ( null ) ; } catch ( Throwable t ) { } return pcl ; } } ) ; } return null ; }
Returns the PlatformClassloader when running with java 9 and above ; otherwise returns null .
36,438
public void setAsynchConsumerCallback ( int requestNumber , int maxActiveMessages , long messageLockExpiry , int batchsize , OrderingContext orderContext , boolean stoppable , int maxSequentialFailures , long hiddenMessageDelay ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setAsynchConsumerCallback" , new Object [ ] { requestNumber , maxActiveMessages , messageLockExpiry , batchsize , orderContext , stoppable , maxSequentialFailures , hiddenMessageDelay } ) ; try { boolean inlineCallbacks = CommsUtils . getRuntimeBooleanProperty ( CommsConstants . INLINE_ASYNC_CBACKS_KEY , CommsConstants . INLINE_ASYNC_CBACKS ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Inline async callbacks: " + inlineCallbacks ) ; MPConsumerSession session = ( MPConsumerSession ) getConsumerSession ( ) ; if ( stoppable ) { session . registerStoppableAsynchConsumerCallback ( this , maxActiveMessages , messageLockExpiry , batchsize , getUnrecoverableReliability ( ) , inlineCallbacks , orderContext , maxSequentialFailures , hiddenMessageDelay ) ; } else { session . registerAsynchConsumerCallback ( this , maxActiveMessages , messageLockExpiry , batchsize , getUnrecoverableReliability ( ) , inlineCallbacks , orderContext ) ; } try { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_REGISTER_ASYNC_CONSUMER_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".setAsynchConsumerCallback" , CommsConstants . CATASYNCHCONSUMER_SETCALLBACK_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2017" , e ) ; } } catch ( SIException e ) { if ( ! ( ( ConversationState ) getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".setAsynchConsumerCallback" , CommsConstants . CATASYNCHCONSUMER_SETCALLBACK_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATASYNCHCONSUMER_SETCALLBACK_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setAsynchConsumerCallback" ) ; }
Creates a normal or stoppable async consumer for this session . This is called in response to the request from a client . This differs from readahead or synchronous sessions where an async callback is registered without the client knowing .
36,439
public void flush ( int requestNumber ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "flush" , "" + requestNumber ) ; try { if ( mainConsumer . isStarted ( ) ) getConsumerSession ( ) . stop ( ) ; getConsumerSession ( ) . activateAsynchConsumer ( true ) ; if ( mainConsumer . isStarted ( ) ) getConsumerSession ( ) . start ( false ) ; short jfapPriority = JFapChannelConstants . getJFAPPriority ( Integer . valueOf ( mainConsumer . getLowestPriority ( ) ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending with JFAP priority of " + jfapPriority ) ; try { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_FLUSH_SESS_R , requestNumber , jfapPriority , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".flush" , CommsConstants . CATASYNCHCONSUMER_FLUSH_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2017" , e ) ; } } catch ( SIException e ) { if ( ! ( ( ConversationState ) getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".flush" , CommsConstants . CATASYNCHCONSUMER_FLUSH_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATASYNCHCONSUMER_FLUSH_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "flush" ) ; }
This method will flush the consumer to ensure it is completely out of messages .
36,440
private boolean sendMessage ( SIBusMessage sibMessage , boolean lastMsg , Integer priority ) throws MessageEncodeFailedException , IncorrectMessageTypeException , MessageCopyFailedException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendMessage" , new Object [ ] { sibMessage , lastMsg , priority } ) ; boolean ok = false ; final HandshakeProperties props = getConversation ( ) . getHandshakeProperties ( ) ; if ( props . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_9 ) { ok = sendChunkedMessage ( sibMessage , lastMsg , priority ) ; } else { ok = sendEntireMessage ( sibMessage , null , lastMsg , priority ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendMessage" , ok ) ; return ok ; }
Method to perform a single send of a message to the client .
36,441
private boolean sendEntireMessage ( SIBusMessage sibMessage , List < DataSlice > messageSlices , boolean lastMsg , Integer priority ) throws MessageEncodeFailedException , IncorrectMessageTypeException , MessageCopyFailedException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendEntireMessage" , new Object [ ] { sibMessage , messageSlices , lastMsg , priority } ) ; if ( lastMsg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending last in batch" ) ; } ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; boolean ok = true ; try { CommsServerByteBuffer byteBuffer = poolManager . allocate ( ) ; int msgLen = 0 ; short msgFlags = CommsConstants . ASYNC_START_OR_MID_BATCH ; if ( lastMsg ) msgFlags |= CommsConstants . ASYNC_LAST_IN_BATCH ; byteBuffer . putShort ( convState . getConnectionObjectId ( ) ) ; byteBuffer . putShort ( mainConsumer . getClientSessionId ( ) ) ; byteBuffer . putShort ( msgFlags ) ; byteBuffer . putShort ( mainConsumer . getMessageBatchNumber ( ) ) ; if ( messageSlices == null ) { msgLen = byteBuffer . putMessage ( ( JsMessage ) sibMessage , convState . getCommsConnection ( ) , getConversation ( ) ) ; } else { msgLen = byteBuffer . putMessgeWithoutEncode ( messageSlices ) ; } int jfapPriority = JFapChannelConstants . getJFAPPriority ( priority ) ; getConversation ( ) . send ( byteBuffer , JFapChannelConstants . SEG_ASYNC_MESSAGE , 0 , jfapPriority , false , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".sendEntireMessage" , CommsConstants . CATASYNCHCONSUMER_SENDENTIREMESS_01 , this ) ; ok = false ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2017" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendEntireMessage" , ok ) ; return ok ; }
Sends the message in one big buffer . If the messageSlices parameter is not null then the message has already been encoded and does not need to be done again . This may be in the case where the message was destined to be sent in chunks but is so small that it does not seem worth it .
36,442
public void consumerSessionStopped ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "consumerSessionStopped" ) ; mainConsumer . stopStoppableSession ( ) ; ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; CommsServerByteBuffer buffer = poolManager . allocate ( ) ; buffer . putShort ( convState . getConnectionObjectId ( ) ) ; buffer . putShort ( getClientSessionId ( ) ) ; try { getConversation ( ) . send ( buffer , JFapChannelConstants . SEG_ASYNC_SESSION_STOPPED_NOREPLY , 0 , JFapChannelConstants . PRIORITY_MEDIUM , false , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".consumerSessionStopped" , CommsConstants . CATASYNCHCONSUMER_SENSSION_STOPPED_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2017" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "consumerSessionStopped" ) ; }
Method called when the asynchronous consumer has been stopped duee to the maxSequentialFailures threshold being reached
36,443
private void checkObjectFactoryAttributes ( ResourceInjectionBinding resourceBinding , ObjectFactoryInfo extensionFactory ) throws InjectionConfigurationException { Resource resourceAnnotation = resourceBinding . getAnnotation ( ) ; if ( ! extensionFactory . isAttributeAllowed ( "authenticationType" ) ) { checkObjectFactoryAttribute ( resourceBinding , "authenticationType" , resourceAnnotation . authenticationType ( ) , AuthenticationType . CONTAINER ) ; } if ( ! extensionFactory . isAttributeAllowed ( "shareable" ) ) { checkObjectFactoryAttribute ( resourceBinding , "shareable" , resourceAnnotation . shareable ( ) , true ) ; } }
Check attributes for registered ObjectFactory s .
36,444
private Reference createExtensionFactoryReference ( ObjectFactoryInfo extensionFactory , ResourceInjectionBinding resourceBinding ) { String className = extensionFactory . getObjectFactoryClass ( ) . getName ( ) ; Reference ref = new Reference ( resourceBinding . getInjectionClassTypeName ( ) , className , null ) ; if ( extensionFactory . isRefAddrNeeded ( ) ) { ref . add ( new ResourceInfoRefAddr ( createResourceInfo ( resourceBinding ) ) ) ; } return ref ; }
Creates a Reference for a binding from a registered ObjectFactory .
36,445
private ResourceInfo createResourceInfo ( ResourceInjectionBinding resourceBinding ) { J2EEName j2eeName = ivNameSpaceConfig . getJ2EEName ( ) ; Resource resourceAnnotation = resourceBinding . getAnnotation ( ) ; return new ResourceInfo ( j2eeName == null ? null : j2eeName . getApplication ( ) , j2eeName == null ? null : j2eeName . getModule ( ) , ivNameSpaceConfig . getDisplayName ( ) , resourceBinding . getJndiName ( ) , resourceBinding . getInjectionClassTypeName ( ) , resourceAnnotation . authenticationType ( ) , resourceAnnotation . shareable ( ) , resourceBinding . ivLink , getResourceRefConfig ( resourceBinding , resourceBinding . getJndiName ( ) , null ) ) ; }
Creates a ResourceInfo for a binding .
36,446
public HttpURLConnection createConnection ( TLSClientParameters tlsClientParameters , Proxy proxy , URL url ) throws IOException { HttpURLConnection connection = ( HttpURLConnection ) ( proxy != null ? url . openConnection ( proxy ) : url . openConnection ( ) ) ; if ( HTTPS_URL_PROTOCOL_ID . equals ( url . getProtocol ( ) ) ) { if ( tlsClientParameters == null ) { tlsClientParameters = new TLSClientParameters ( ) ; } Exception ex = null ; try { decorateWithTLS ( tlsClientParameters , connection ) ; } catch ( Exception e ) { ex = e ; } finally { if ( ex != null ) { if ( ex instanceof IOException ) { throw ( IOException ) ex ; } IOException ioException = new IOException ( "Error while initializing secure socket" ) ; ioException . initCause ( ex ) ; throw ioException ; } } } return connection ; }
Create a HttpURLConnection proxified if necessary .
36,447
public static List < Parameter > collectConstructorParameters ( Class < ? > cls , Components components , javax . ws . rs . Consumes classConsumes ) { if ( cls . isLocalClass ( ) || ( cls . isMemberClass ( ) && ! Modifier . isStatic ( cls . getModifiers ( ) ) ) ) { return Collections . emptyList ( ) ; } List < Parameter > selected = Collections . emptyList ( ) ; int maxParamsCount = 0 ; for ( Constructor < ? > constructor : cls . getDeclaredConstructors ( ) ) { if ( ! ReflectionUtils . isConstructorCompatible ( constructor ) && ! ReflectionUtils . isInject ( Arrays . asList ( constructor . getDeclaredAnnotations ( ) ) ) ) { continue ; } final Type [ ] genericParameterTypes = constructor . getGenericParameterTypes ( ) ; final Annotation [ ] [ ] annotations = constructor . getParameterAnnotations ( ) ; int paramsCount = 0 ; final List < Parameter > parameters = new ArrayList < Parameter > ( ) ; for ( int i = 0 ; i < genericParameterTypes . length ; i ++ ) { final List < Annotation > tmpAnnotations = Arrays . asList ( annotations [ i ] ) ; if ( isContext ( tmpAnnotations ) ) { paramsCount ++ ; } else { final Type genericParameterType = genericParameterTypes [ i ] ; final List < Parameter > tmpParameters = collectParameters ( genericParameterType , tmpAnnotations , components , classConsumes ) ; if ( tmpParameters . size ( ) >= 1 ) { for ( Parameter tmpParameter : tmpParameters ) { if ( ParameterProcessor . applyAnnotations ( tmpParameter , genericParameterType , tmpAnnotations , components , classConsumes == null ? new String [ 0 ] : classConsumes . value ( ) , null ) != null ) { parameters . add ( tmpParameter ) ; } } paramsCount ++ ; } } } if ( paramsCount >= maxParamsCount ) { maxParamsCount = paramsCount ; selected = parameters ; } } return selected ; }
Collects constructor - level parameters from class .
36,448
public static List < Parameter > collectFieldParameters ( Class < ? > cls , Components components , javax . ws . rs . Consumes classConsumes ) { final List < Parameter > parameters = new ArrayList < Parameter > ( ) ; for ( Field field : ReflectionUtils . getDeclaredFields ( cls ) ) { final List < Annotation > annotations = Arrays . asList ( field . getAnnotations ( ) ) ; final Type genericType = field . getGenericType ( ) ; parameters . addAll ( collectParameters ( genericType , annotations , components , classConsumes ) ) ; } return parameters ; }
Collects field - level parameters from class .
36,449
public static String [ ] splitContentValues ( String [ ] strings ) { final Set < String > result = new LinkedHashSet < String > ( ) ; for ( String string : strings ) { if ( string . isEmpty ( ) ) continue ; String [ ] splitted = string . trim ( ) . split ( "," ) ; for ( String string2 : splitted ) { result . add ( string2 ) ; } } return result . toArray ( new String [ result . size ( ) ] ) ; }
Splits the provided array of strings into an array using comma as the separator . Also removes leading and trailing whitespace and omits empty strings from the results .
36,450
public static boolean objectsNotEqual ( final Object one , final Object two ) { return ( one == null ) ? ( two != null ) : ( ! one . equals ( two ) ) ; }
Compares two objects for equality .
36,451
public static void addFieldToString ( final StringBuffer buffer , final String name , final Object value ) { buffer . append ( " <" ) ; buffer . append ( name ) ; buffer . append ( "=" ) ; buffer . append ( value ) ; buffer . append ( ">" ) ; }
Adds a string representation of the given field to the buffer .
36,452
public static void addPasswordFieldToString ( final StringBuffer buffer , final String name , final Object value ) { addFieldToString ( buffer , name , ( value == null ) ? null : "*****" ) ; }
Adds a string representation of the given password to the buffer . This will contain a row of asterisks if the password is non - null .
36,453
public final void service ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { _jspService ( request , response ) ; }
Entry point into service .
36,454
public Object put ( long key , Object value ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "put" , new Object [ ] { new Long ( key ) , value , this } ) ; if ( value == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "put" , "IllegalArgumentException" ) ; throw new IllegalArgumentException ( "Null is not a permitted value." ) ; } int hash = getHashForNewEntry ( key ) ; Object previous = _values [ hash ] == DELETED ? null : _values [ hash ] ; _values [ hash ] = value ; _keys [ hash ] = key ; if ( previous == null ) { _currentLoad ++ ; if ( _currentLoad == _resizeThreshold ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "put" , new Object [ ] { new Long ( key ) , value , this } ) ; long [ ] oldKeys = new long [ _mapSize ] ; Object [ ] oldValues = new Object [ _mapSize ] ; System . arraycopy ( _keys , 0 , oldKeys , 0 , oldKeys . length ) ; System . arraycopy ( _values , 0 , oldValues , 0 , oldValues . length ) ; _mapSize = ( _mapSize * 2 ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "mapSize = " + _mapSize ) ; _resizeThreshold = ( int ) ( ( ( float ) _mapSize ) * ( ( float ) _loadFactor ) / 100f ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "resizeThreshold = " + _resizeThreshold ) ; _values = new Object [ _mapSize ] ; _keys = new long [ _mapSize ] ; _currentLoad = 0 ; for ( int i = 0 ; i < oldValues . length ; i ++ ) { Object oldValue = oldValues [ i ] ; if ( oldValue != null && oldValue != DELETED ) { put ( oldKeys [ i ] , oldValue ) ; } } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "put" , previous ) ; return previous ; }
Store the given value in the map associating it with the given key . If the map already contains an entry associated with the given key that entry will be replaced .
36,455
public Object remove ( long key ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "remove" , new Object [ ] { new Long ( key ) , this } ) ; int hash = getHashForExistingEntry ( key ) ; Object result = null ; if ( hash >= 0 ) { result = _values [ hash ] ; } if ( result != null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Entry found in map - removing" ) ; _values [ hash ] = DELETED ; _currentLoad -- ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "remove" , result ) ; return result ; }
Remove the entry from the map that is associated with the given key .
36,456
public Object get ( long key ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "get" , new Object [ ] { new Long ( key ) , this } ) ; int hash = getHashForExistingEntry ( key ) ; Object value = null ; if ( hash >= 0 ) { value = _values [ hash ] ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "get" , value ) ; return value ; }
Return the entry from the map associated with the given key
36,457
private int getHashForKey ( long key ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getHashForKey" , new Object [ ] { new Long ( key ) , this } ) ; int hash = ( int ) ( key % _mapSize ) ; if ( hash < 0 ) hash = - hash ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getHashForKey" , new Integer ( hash ) ) ; return hash ; }
suitable int index into the map
36,458
private void processConfigProps ( Map < String , Object > props ) { if ( props == null || props . isEmpty ( ) ) return ; id = ( String ) props . get ( CFG_KEY_ID ) ; if ( id == null ) { Tr . error ( tc , "AUTHZ_ROLE_ID_IS_NULL" ) ; return ; } rolePids = ( String [ ] ) props . get ( CFG_KEY_ROLE ) ; processRolePids ( ) ; }
Process the sytemRole properties from the server . xml .
36,459
private Configuration retrieveConfig ( NestedConfigHelper configHelper , ConfigurationAdmin configAdmin ) throws InitWithoutConfig { if ( configHelper == null ) throw new InitWithoutConfig ( "Configuration not found" ) ; if ( configAdmin == null ) throw new InitWithoutConfig ( "ConfigurationAdmin service not found" ) ; String parentPid = ( String ) configHelper . get ( Constants . SERVICE_PID ) ; String sourcePid = ( String ) configHelper . get ( "ibm.extends.source.pid" ) ; if ( sourcePid != null ) { parentPid = sourcePid ; } try { StringBuilder filter = new StringBuilder ( ) ; filter . append ( "(&" ) ; filter . append ( FilterUtils . createPropertyFilter ( "service.factoryPid" , "com.ibm.ws.classloading.classloader" ) ) ; filter . append ( FilterUtils . createPropertyFilter ( "config.parentPID" , parentPid ) ) ; filter . append ( ")" ) ; Configuration [ ] configs = configAdmin . listConfigurations ( filter . toString ( ) ) ; if ( configs == null || configs . length != 1 ) { throw new InitWithoutConfig ( "No classloader element found" ) ; } Configuration config = configs [ 0 ] ; if ( config . getProperties ( ) == null ) { if ( tc . isErrorEnabled ( ) ) Tr . error ( tc , "cls.classloader.missing" , config . getPid ( ) ) ; config . delete ( ) ; throw new InitWithoutConfig ( "Classloader config not found" ) ; } return config ; } catch ( IOException e ) { throw new InitWithoutConfig ( "Configuration for classloader not found, exception " + e ) ; } catch ( InvalidSyntaxException e ) { throw new InitWithoutConfig ( "Configuration for classloader not found, exception " + e ) ; } }
get the configuration object or die trying
36,460
private List < String > getIds ( ConfigurationAdmin ca , String [ ] pids ) { final String methodName = "getIds(): " ; if ( pids == null ) { return Collections . emptyList ( ) ; } List < String > ids = new ArrayList < String > ( ) ; for ( String pid : pids ) { try { String filter = "(" + org . osgi . framework . Constants . SERVICE_PID + "=" + pid + ")" ; Configuration [ ] config = ca . listConfigurations ( filter ) ; if ( config == null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Configuration not found for pid " + pid ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Found config for " + pid ) ; String id = ( String ) config [ 0 ] . getProperties ( ) . get ( "id" ) ; ids . add ( id ) ; } } catch ( IOException e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Configuration not found for " + pid , e ) ; } catch ( InvalidSyntaxException e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Configuration not found for " + pid , e ) ; } } return Collections . unmodifiableList ( ids ) ; }
Find the PID in the configAdmin and get the id corresponding to it .
36,461
private boolean folderContainsFiles ( File folder ) { if ( folder != null ) { File [ ] files = folder . listFiles ( ) ; for ( File file : files ) if ( file . isFile ( ) ) return true ; for ( File file : files ) if ( file . isDirectory ( ) ) if ( folderContainsFiles ( file ) ) return true ; } return false ; }
Breadth - first traversal of folder and any subdirectories looking for if any files exist
36,462
public static ASN1Sequence getInstance ( Object obj ) { if ( obj == null || obj instanceof ASN1Sequence ) { return ( ASN1Sequence ) obj ; } throw new IllegalArgumentException ( "unknown object in getInstance" ) ; }
return an ASN1Sequence from the given object .
36,463
private static boolean markError ( OverlayContainer overlay , String errorTag ) { if ( overlay . getFromNonPersistentCache ( errorTag , WebExtAdapter . class ) == null ) { overlay . addToNonPersistentCache ( errorTag , WebExtAdapter . class , errorTag ) ; return true ; } else { return false ; } }
Mark an error condition to an overlay container .
36,464
@ FFDCIgnore ( ParseException . class ) public com . ibm . ws . javaee . dd . webext . WebExt adapt ( Container root , OverlayContainer rootOverlay , ArtifactContainer artifactContainer , Container containerToAdapt ) throws UnableToAdaptException { com . ibm . ws . javaee . dd . web . WebApp primary = containerToAdapt . adapt ( com . ibm . ws . javaee . dd . web . WebApp . class ) ; String primaryVersion = ( ( primary == null ) ? null : primary . getVersion ( ) ) ; boolean xmi = ( "2.2" . equals ( primaryVersion ) || "2.3" . equals ( primaryVersion ) || "2.4" . equals ( primaryVersion ) ) ; String ddEntryName ; if ( xmi ) { ddEntryName = com . ibm . ws . javaee . dd . webext . WebExt . XMI_EXT_NAME ; } else { ddEntryName = com . ibm . ws . javaee . dd . webext . WebExt . XML_EXT_NAME ; } Entry ddEntry = containerToAdapt . getEntry ( ddEntryName ) ; com . ibm . ws . javaee . ddmodel . webext . WebExtComponentImpl fromConfig = getConfigOverrides ( rootOverlay , artifactContainer ) ; if ( ( ddEntry == null ) && ( fromConfig == null ) ) { return null ; } if ( ddEntry != null ) { com . ibm . ws . javaee . dd . webext . WebExt fromApp ; try { fromApp = new com . ibm . ws . javaee . ddmodel . webext . WebExtDDParser ( containerToAdapt , ddEntry , xmi ) . parse ( ) ; } catch ( ParseException e ) { throw new UnableToAdaptException ( e ) ; } if ( fromConfig == null ) { return fromApp ; } else { fromConfig . setDelegate ( fromApp ) ; return fromConfig ; } } else { return fromConfig ; } }
Obtain the web extension for a module container .
36,465
private String stripExtension ( String moduleName ) { if ( moduleName . endsWith ( ".war" ) || moduleName . endsWith ( ".jar" ) ) { return moduleName . substring ( 0 , moduleName . length ( ) - 4 ) ; } return moduleName ; }
Strip the extension from a module name .
36,466
public final boolean isReconfigurable ( WSConnectionRequestInfoImpl cri , boolean reauth ) { if ( reauth ) { return ivConfigID == cri . ivConfigID ; } else { return match ( ivUserName , cri . ivUserName ) && match ( ivPassword , cri . ivPassword ) && match ( ivShardingKey , cri . ivShardingKey ) && match ( ivSuperShardingKey , cri . ivSuperShardingKey ) && ivConfigID == cri . ivConfigID ; } }
Indicates whether a Connection with this CRI may be reconfigured to the specific CRI .
36,467
private boolean matchKerberosIdentities ( WSConnectionRequestInfoImpl cri ) { boolean flag = false ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "matchKerberosIdentities" , this , cri ) ; if ( kerberosIdentityisSet && cri . kerberosIdentityisSet ) { flag = AdapterUtil . matchGSSName ( cri . gssName , gssName ) ; } else if ( kerberosIdentityisSet || cri . kerberosIdentityisSet ) { flag = false ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "only one has kerberos identity attributes set so no match" ) ; } else { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "both have kerberos identity attributes not set so match" ) ; flag = true ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "matchKerberosIdentities" , flag ) ; return flag ; }
Per JAVA Docs method returns true if the two names contain at least one primitive element in common . If either of the names represents an anonymous entity the method will return false .
36,468
private static final boolean match ( Object obj1 , Object obj2 ) { return obj1 == obj2 || ( obj1 != null && obj1 . equals ( obj2 ) ) ; }
Determine if two objects either of which may be null are equal .
36,469
private final boolean matchCatalog ( WSConnectionRequestInfoImpl cri ) { String defaultValue = defaultCatalog == null ? cri . defaultCatalog : defaultCatalog ; return match ( ivCatalog , cri . ivCatalog ) || ivCatalog == null && match ( defaultValue , cri . ivCatalog ) || cri . ivCatalog == null && match ( ivCatalog , defaultValue ) ; }
Determine if the catalog property matches . It is considered to match if - Both catalog values are unspecified . - Both catalog values are the same value . - One of the catalog values is unspecified and the other CRI requested the default value .
36,470
private final boolean matchSchema ( WSConnectionRequestInfoImpl cri ) { String defaultValue = defaultSchema == null ? cri . defaultSchema : defaultSchema ; return match ( ivSchema , cri . ivSchema ) || ivSchema == null && match ( defaultValue , cri . ivSchema ) || cri . ivSchema == null && match ( ivSchema , defaultValue ) ; }
Determine if the schema property matches . It is considered to match if - Both schema values are unspecified . - Both schema values are the same value . - One of the schema values is unspecified and the other CRI requested the default value .
36,471
private final boolean matchNetworkTimeout ( WSConnectionRequestInfoImpl cri ) { int defaultValue = defaultNetworkTimeout == 0 ? cri . defaultNetworkTimeout : defaultNetworkTimeout ; return ivNetworkTimeout == cri . ivNetworkTimeout || ivNetworkTimeout == 0 && ( defaultValue == cri . ivNetworkTimeout ) || cri . ivNetworkTimeout == 0 && ivNetworkTimeout == defaultValue ; }
Determine if the networkTimeout property matches . It is considered to match if - Both networkTimeout values are unspecified . - Both networkTimeout values are the same value . - One of the networkTimeout values is unspecified and the other CRI requested the default value .
36,472
private final boolean matchHoldability ( WSConnectionRequestInfoImpl cri ) { int defaultValue = defaultHoldability == 0 ? cri . defaultHoldability : defaultHoldability ; return ivHoldability == cri . ivHoldability || ivHoldability == 0 && match ( defaultValue , cri . ivHoldability ) || cri . ivHoldability == 0 && match ( ivHoldability , defaultValue ) ; }
Determine if the result set holdability property matches . It is considered to match if - Both holdability values are unspecified . - Both holdability values are the same value . - One of the holdability values is unspecified and the other CRI requested the default value .
36,473
private final boolean matchReadOnly ( WSConnectionRequestInfoImpl cri ) { Boolean defaultValue = defaultReadOnly == null ? cri . defaultReadOnly : defaultReadOnly ; return match ( ivReadOnly , cri . ivReadOnly ) || ivReadOnly == null && match ( defaultValue , cri . ivReadOnly ) || cri . ivReadOnly == null && match ( ivReadOnly , defaultValue ) ; }
Determine if the read - only property matches . It is considered to match if - Both read - only values are unspecified . - Both read - only values are the same value . - One of the read - only values is unspecified and the other CRI requested the default value .
36,474
private final boolean matchTypeMap ( WSConnectionRequestInfoImpl cri ) { Map < String , Class < ? > > defaultValue = defaultTypeMap == null ? cri . defaultTypeMap : defaultTypeMap ; return matchTypeMap ( ivTypeMap , cri . ivTypeMap ) || ivTypeMap == null && matchTypeMap ( defaultValue , cri . ivTypeMap ) || cri . ivTypeMap == null && matchTypeMap ( ivTypeMap , defaultValue ) ; }
Determine if the type map property matches . It is considered to match if - Both type map values are unspecified . - Both type map values are the same value . - One of the type map values is unspecified and the other CRI requested the default value .
36,475
public static final boolean matchTypeMap ( Map < String , Class < ? > > m1 , Map < String , Class < ? > > m2 ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "matchTypeMap" , new Object [ ] { m1 , m2 } ) ; boolean match = false ; if ( m1 == m2 ) match = true ; else if ( m1 != null && m1 . equals ( m2 ) ) match = true ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "matchTypeMap" , match ) ; return match ; }
determines if two typeMaps match . Note that this method takes under account an Oracle 11g change with TypeMap
36,476
public void setDefaultValues ( String catalog , int holdability , Boolean readOnly , Map < String , Class < ? > > typeMap , String schema , int networkTimeout ) { defaultCatalog = catalog ; defaultHoldability = holdability ; defaultReadOnly = readOnly ; defaultTypeMap = typeMap ; defaultSchema = schema ; defaultNetworkTimeout = networkTimeout ; }
Initialize default values that are used for unspecified properties . This allows us to match unspecified values with specified values in another CRI .
36,477
public boolean isCRIChangable ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "isCRIChangable :" , changable ) ; return changable ; }
returns boolean indicating if cri is changable or not .
36,478
public void setCatalog ( String catalog ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: catalog, cri" , catalog , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting catalog on the CRI to: " + catalog ) ; ivCatalog = catalog ; }
Change the value of the catalog property in the connection request information .
36,479
public void setHoldability ( int holdability ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: holdability, cri" , holdability , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting holdability on the CRI to: " + holdability ) ; ivHoldability = holdability ; }
Change the value of the result set holdability property in the connection request information .
36,480
public void setTransactionIsolationLevel ( int iso ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , "ConnectionRequestInfo cannot be modified, doing so may result in corruption: iso , cri" , iso , this ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting isolation level on the CRI to:" , iso ) ; ivIsoLevel = iso ; }
sets the isolation level for this CRI . The J2C team are aware of the change and they are ok with setting the isolation level as the values are not part of the hashCode and hence any changes there will not affect the bucket in which the mc will reside in the connection pool We are in need for setting the cri in case the application sets the value on the connection .
36,481
public void setReadOnly ( boolean readOnly ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: readOnly , cri" , readOnly , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting read only on the CRI to:" , readOnly ) ; ivReadOnly = readOnly ; }
sets the readonly for this CRI . The J2C team are aware of the change and they are ok with setting the readonly as the values are not part of the hashCode and hence any changes there will not affect the bucket in which the mc will reside in the connection pool . We are in need for setting the cri in case the application sets the value on the connection .
36,482
public void setShardingKey ( Object shardingKey ) throws SQLException { if ( ! changable ) throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , "ConnectionRequestInfo cannot be modified, doing so may result in corruption: shardingKey, cri" , shardingKey , this ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting sharding key on the CRI to: " + shardingKey ) ; ivShardingKey = shardingKey ; }
Change the value of the sharding key property in the connection request information .
36,483
public void setSuperShardingKey ( Object superShardingKey ) throws SQLException { if ( ! changable ) throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , "ConnectionRequestInfo cannot be modified, doing so may result in corruption: superShardingKey, cri" , superShardingKey , this ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting super sharding key on the CRI to: " + superShardingKey ) ; ivSuperShardingKey = superShardingKey ; }
Change the value of the super sharding key property in the connection request information .
36,484
public void setTypeMap ( Map < String , Class < ? > > map ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: type map, cri" , map , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting the type map on the CRI to: " + map ) ; ivTypeMap = map ; }
Change the value of the type map property in the connection request information .
36,485
public static WSConnectionRequestInfoImpl createChangableCRIFromNon ( WSConnectionRequestInfoImpl oldCRI ) { WSConnectionRequestInfoImpl connInfo = new WSConnectionRequestInfoImpl ( oldCRI . getUserName ( ) , oldCRI . getPassword ( ) , oldCRI . getIsolationLevel ( ) , oldCRI . getCatalog ( ) , oldCRI . isReadOnly ( ) , oldCRI . getShardingKey ( ) , oldCRI . getSuperShardingKey ( ) , oldCRI . getTypeMap ( ) , oldCRI . getHoldability ( ) , oldCRI . getSchema ( ) , oldCRI . getNetworkTimeout ( ) , oldCRI . getConfigID ( ) , oldCRI . getSupportIsolvlSwitchingValue ( ) ) ; connInfo . setDefaultValues ( oldCRI . defaultCatalog , oldCRI . defaultHoldability , oldCRI . defaultReadOnly , oldCRI . defaultTypeMap , oldCRI . defaultSchema , oldCRI . defaultNetworkTimeout ) ; connInfo . markAsChangable ( ) ; return connInfo ; }
utility to create changable CRI from non changable one .
36,486
protected void processAnnotations ( Object instance ) throws IllegalAccessException , InvocationTargetException , NamingException { if ( context == null ) { return ; } checkAnnotation ( instance . getClass ( ) , instance ) ; Class superclass = instance . getClass ( ) . getSuperclass ( ) ; while ( superclass != null && ( ! superclass . equals ( Object . class ) ) ) { checkAnnotation ( superclass , instance ) ; superclass = superclass . getSuperclass ( ) ; } }
Inject resources in specified instance .
36,487
protected static void lookupMethodResource ( javax . naming . Context context , Object instance , Method method , String name ) throws NamingException , IllegalAccessException , InvocationTargetException { if ( ! method . getName ( ) . startsWith ( "set" ) || method . getParameterTypes ( ) . length != 1 || ! method . getReturnType ( ) . getName ( ) . equals ( "void" ) ) { throw new IllegalArgumentException ( "Invalid method resource injection annotation" ) ; } Object lookedupResource ; if ( ( name != null ) && ( name . length ( ) > 0 ) ) { lookedupResource = context . lookup ( JAVA_COMP_ENV + name ) ; } else { lookedupResource = context . lookup ( JAVA_COMP_ENV + instance . getClass ( ) . getName ( ) + "/" + getFieldName ( method ) ) ; } boolean accessibility = method . isAccessible ( ) ; method . setAccessible ( true ) ; method . invoke ( instance , lookedupResource ) ; method . setAccessible ( accessibility ) ; }
Inject resources in specified method .
36,488
private void _send ( SIBusMessage msg , SITransaction tran ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIErrorException , SINotAuthorizedException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_send" ) ; boolean sendSuccessful = false ; short jfapPriority = JFapChannelConstants . getJFAPPriority ( msg . getPriority ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending with JFAP priority of " + jfapPriority ) ; updateLowestPriority ( jfapPriority ) ; final boolean requireReply ; if ( tran != null && ! exchangeTransactedSends ) { requireReply = false ; } else if ( exchangeExpressSends ) { requireReply = true ; } else { requireReply = ( msg . getReliability ( ) != Reliability . BEST_EFFORT_NONPERSISTENT ) && ( msg . getReliability ( ) != Reliability . EXPRESS_NONPERSISTENT ) ; } final HandshakeProperties props = getConversation ( ) . getHandshakeProperties ( ) ; if ( props . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_9 ) { sendChunkedMessage ( tran , msg , requireReply , jfapPriority ) ; } else { sendEntireMessage ( tran , msg , null , requireReply , jfapPriority ) ; } sendSuccessful = true ; if ( TraceComponent . isAnyTracingEnabled ( ) ) CommsLightTrace . traceMessageId ( tc , "SendMsgTrace" , msg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_send" ) ; }
This method performs the actual send but does no parameter checking and gets no locks needed to perform the send . This should be done by a suitable super - method .
36,489
private void sendEntireMessage ( SITransaction tran , SIBusMessage msg , List < DataSlice > messageSlices , boolean requireReply , short jfapPriority ) throws SIResourceException , SISessionUnavailableException , SINotPossibleInCurrentConfigurationException , SIIncorrectCallException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendEntireMessage" , new Object [ ] { tran , msg , messageSlices , requireReply , jfapPriority } ) ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; request . putSITransaction ( tran ) ; if ( messageSlices == null ) { request . putClientMessage ( msg , getCommsConnection ( ) , getConversation ( ) ) ; } else { request . putMessgeWithoutEncode ( messageSlices ) ; } sendData ( request , jfapPriority , requireReply , tran , JFapChannelConstants . SEG_SEND_SESS_MSG , JFapChannelConstants . SEG_SEND_SESS_MSG_NOREPLY , JFapChannelConstants . SEG_SEND_SESS_MSG_R ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendEntireMessage" ) ; }
Sends the entire message in one big JFap message . This requires the allocation of one big area of storage for the whole message . If the messageSlices parameter is not null then the message has already been encoded and can just be added into the buffer without encoding again .
36,490
private void sendData ( CommsByteBuffer request , short jfapPriority , boolean requireReply , SITransaction tran , int outboundSegmentType , int outboundNoReplySegmentType , int replySegmentType ) throws SIResourceException , SISessionUnavailableException , SINotPossibleInCurrentConfigurationException , SIIncorrectCallException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendData" , new Object [ ] { request , jfapPriority , requireReply , tran , outboundSegmentType , outboundNoReplySegmentType , replySegmentType } ) ; if ( requireReply ) { CommsByteBuffer reply = jfapExchange ( request , outboundSegmentType , jfapPriority , false ) ; try { short err = reply . getCommandCompletionCode ( replySegmentType ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SILimitExceededException ( reply , err ) ; checkFor_SINotAuthorizedException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SINotPossibleInCurrentConfigurationException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } } else { jfapSend ( request , outboundNoReplySegmentType , jfapPriority , false , ThrottlingPolicy . BLOCK_THREAD ) ; if ( tran != null ) { ( ( Transaction ) tran ) . updateLowestMessagePriority ( jfapPriority ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendData" ) ; }
This helper method is used to send the final or only part of a message to our peer . It takes care of whether we should be exchanging the message and deals with the exceptions returned .
36,491
public void close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; if ( ! isClosed ( ) ) { try { closeLock . writeLock ( ) . lockInterruptibly ( ) ; try { CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_CLOSE_PRODUCER_SESS , lowestPriority , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_CLOSE_PRODUCER_SESS_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } setClosed ( ) ; if ( oc != null ) oc . decrementUseCount ( ) ; } finally { closeLock . writeLock ( ) . unlock ( ) ; } } catch ( InterruptedException e ) { } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
Closes the ProducerSession .
36,492
private static Object getFieldValue ( FieldClassValue fieldClassValue , Object obj ) { try { return fieldClassValue . get ( obj . getClass ( ) ) . get ( obj ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( e ) ; } }
Get the value of a field from an object .
36,493
public static WrapperProxyState getLocalBeanWrapperProxyState ( LocalBeanWrapperProxy obj ) { BusinessLocalWrapperProxy proxyStateHolder = ( BusinessLocalWrapperProxy ) getFieldValue ( svLocalBeanWrapperProxyStateFieldClassValue , obj ) ; return proxyStateHolder . ivState ; }
Returns the wrapper proxy object for an object that implements LocalBeanWrapperProxy . This operation should never fail but if it does exceptions will be thrown as EJBException .
36,494
protected void registerServant ( ) { if ( ivRemoteObjectWrapper != null ) { synchronized ( ivRemoteObjectWrapper ) { if ( ! isRemoteRegistered ) { try { if ( ! isZOS ) { Object originalLoader = ThreadContextAccessor . UNCHANGED ; try { if ( ivBMD != null ) { originalLoader = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( ivBMD . classLoader ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( originalLoader != ThreadContextAccessor . UNCHANGED ) { Tr . debug ( tc , "registerServant : old ClassLoader = " + originalLoader ) ; Tr . debug ( tc , "registerServant : new ClassLoader = " + ivBMD . classLoader ) ; } else { Tr . debug ( tc , "registerServant : current ClassLoader = " + ivBMD . classLoader ) ; } } } ivRemoteObjectWrapper . container . getEJBRuntime ( ) . registerServant ( ivRemoteObjectWrapper . beanId . getByteArray ( ) , ivRemoteObjectWrapper ) ; } finally { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( originalLoader ) ; } } isRemoteRegistered = true ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".registerServant" , "184" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to register wrapper instance" , new Object [ ] { ivRemoteObjectWrapper , ex } ) ; } } } } } }
Register the remote wrapper servant to ORB .
36,495
private void registerServant ( BusinessRemoteWrapper wrapper , int i ) { synchronized ( wrapper ) { if ( ! ivBusinessRemoteRegistered [ i ] ) { try { if ( ! isZOS ) { WrapperId wrapperId = new WrapperId ( wrapper . beanId . getByteArrayBytes ( ) , wrapper . bmd . ivBusinessRemoteInterfaceClasses [ i ] . getName ( ) , i ) ; Object originalLoader = ThreadContextAccessor . UNCHANGED ; try { if ( ivBMD != null ) { originalLoader = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( ivBMD . classLoader ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( originalLoader != ThreadContextAccessor . UNCHANGED ) { Tr . debug ( tc , "registerServant : old ClassLoader = " + originalLoader ) ; Tr . debug ( tc , "registerServant : new ClassLoader = " + ivBMD . classLoader ) ; } else { Tr . debug ( tc , "registerServant : current ClassLoader = " + ivBMD . classLoader ) ; } } } wrapper . container . getEJBRuntime ( ) . registerServant ( wrapperId , wrapper ) ; } finally { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( originalLoader ) ; } } ivBusinessRemoteRegistered [ i ] = true ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".registerServant" , "439" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to register wrapper instance" , new Object [ ] { wrapper , ex } ) ; } } } } }
d416391 added entire method .
36,496
protected void disconnect ( ) { if ( localWrapperProxyState != null ) { localWrapperProxyState . disconnect ( ) ; } if ( ivBusinessLocalWrapperProxyStates != null ) { for ( WrapperProxyState state : ivBusinessLocalWrapperProxyStates ) { state . disconnect ( ) ; } } if ( ivRemoteObjectWrapper != null ) { synchronized ( ivRemoteObjectWrapper ) { if ( isRemoteRegistered ) { try { if ( ( ! isZOS ) || ( ivRemoteObjectWrapper . intie != null ) ) { ivRemoteObjectWrapper . container . getEJBRuntime ( ) . unregisterServant ( ivRemoteObjectWrapper ) ; } isRemoteRegistered = false ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".unregisterServant" , "207" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to unregister wrapper instance" , new Object [ ] { ivRemoteObjectWrapper , ex } ) ; } } } } } if ( ivBusinessRemote != null ) { int numWrappers = ivBusinessRemote . length ; for ( int i = 0 ; i < numWrappers ; ++ i ) { BusinessRemoteWrapper wrapper = ivBusinessRemote [ i ] ; synchronized ( wrapper ) { if ( ivBusinessRemoteRegistered [ i ] ) { try { if ( ( ! isZOS ) || ( wrapper . intie != null ) ) { wrapper . container . getEJBRuntime ( ) . unregisterServant ( wrapper ) ; } ivBusinessRemoteRegistered [ i ] = false ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".unregisterServant" , "516" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to unregister wrapper instance" , new Object [ ] { wrapper , ex } ) ; } } } } } } }
Disconnect all wrappers . Unregisters the remote wrapper servant from ORB and disconnects local wrapper proxy states .
36,497
public EJBLocalObject getLocalObject ( ) { if ( localObject != null ) { if ( localWrapperProxyState != null && localWrapperProxyState . ivWrapper == null ) { localWrapperProxyState . connect ( ivBeanId , localWrapper ) ; } return localObject ; } throw new IllegalStateException ( "Local interface not defined" ) ; }
Returns a client proxy object for the local component view .
36,498
public Object getBusinessObject ( String interfaceName ) throws RemoteException { int interfaceIndex = ivBMD . getLocalBusinessInterfaceIndex ( interfaceName ) ; if ( interfaceIndex != - 1 ) { return getLocalBusinessObject ( interfaceIndex ) ; } interfaceIndex = ivBMD . getRemoteBusinessInterfaceIndex ( interfaceName ) ; if ( interfaceIndex != - 1 ) { return getRemoteBusinessObject ( interfaceIndex ) ; } throw new IllegalStateException ( "Requested business interface not found : " + interfaceName ) ; }
Method to get a business object given the name of the interface .
36,499
public Object getLocalBusinessObject ( int interfaceIndex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getLocalBusinessObject : " + ivBusinessLocalProxies [ interfaceIndex ] . getClass ( ) . getName ( ) ) ; if ( ivBusinessLocalWrapperProxyStates != null && ivBusinessLocalWrapperProxyStates [ interfaceIndex ] . ivWrapper == null ) { ivBusinessLocalWrapperProxyStates [ interfaceIndex ] . connect ( ivBeanId , ivBusinessLocal [ interfaceIndex ] ) ; } return ivBusinessLocalProxies [ interfaceIndex ] ; }
Method to get the local business object given the index of the interface . The returned object will be a wrapper a no - interface wrapper or a local wrapper proxy .