idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
25,500
void topicSpaceDeleted ( DestinationHandler destination ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "topicSpaceDeleted" , destination ) ; synchronized ( _topicSpaces ) { final HashMap pubsubOutputHandlers = ( HashMap ) ( destination . getAllPubSubOutputHandlers ( ) ) . clone ( ) ; destination . unlockPubsubOutputHandlers ( ) ; if ( pubsubOutputHandlers != null && pubsubOutputHandlers . size ( ) > 0 ) { final ArrayList topicSpacesDeleted = new ArrayList ( ) ; final ArrayList topicsDeleted = new ArrayList ( ) ; final Iterator neighbourUuids = pubsubOutputHandlers . keySet ( ) . iterator ( ) ; while ( neighbourUuids . hasNext ( ) ) { topicSpacesDeleted . clear ( ) ; topicsDeleted . clear ( ) ; final SIBUuid8 neighbourUuid = ( SIBUuid8 ) neighbourUuids . next ( ) ; final PubSubOutputHandler handler = ( PubSubOutputHandler ) pubsubOutputHandlers . get ( neighbourUuid ) ; final String topics [ ] = handler . getTopics ( ) ; Neighbour neighbour = getNeighbour ( neighbourUuid ) ; boolean warmRestarted = false ; if ( neighbour == null ) { synchronized ( _recoveredNeighbours ) { neighbour = ( Neighbour ) _recoveredNeighbours . get ( neighbourUuid ) ; } warmRestarted = true ; } if ( neighbour != null && topics != null ) { for ( int i = 0 ; i < topics . length ; i ++ ) { if ( ! warmRestarted ) { MESubscription meSub = neighbour . getSubscription ( destination . getUuid ( ) , topics [ i ] ) ; ControllableProxySubscription sub = meSub . getMatchspaceSub ( ) ; _proxyHandler . getMessageProcessor ( ) . getMessageProcessorMatching ( ) . removePubSubOutputHandlerMatchTarget ( sub ) ; destination . getSubscriptionIndex ( ) . remove ( sub ) ; } handler . removeTopic ( topics [ i ] ) ; addTopicSpaceReference ( neighbourUuid , destination . getUuid ( ) , topics [ i ] , warmRestarted ) ; topicSpacesDeleted . add ( destination . getUuid ( ) ) ; topicsDeleted . add ( topics [ i ] ) ; } } destination . deletePubSubOutputHandler ( neighbourUuid ) ; if ( neighbour != null ) _proxyHandler . unsubscribeEvent ( topicSpacesDeleted , topicsDeleted , neighbour . getBusId ( ) , null ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "topicSpaceDeleted" ) ; }
If a topicSpace is deleted remove all the PubSubOutputHandlers registered against it and add them to an in memory reference table .
25,501
protected void removeNeighbour ( SIBUuid8 meUUID , String busId , Transaction transaction ) throws SIConnectionLostException , SIResourceException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeNeighbour" , new Object [ ] { busId , transaction } ) ; boolean recoveredNeighbour = false ; Neighbour neighbour = null ; synchronized ( _neighbours ) { neighbour = ( Neighbour ) _neighbours . get ( meUUID ) ; } if ( neighbour == null ) { recoveredNeighbour = true ; synchronized ( _recoveredNeighbours ) { neighbour = ( Neighbour ) _recoveredNeighbours . get ( meUUID ) ; } } if ( neighbour != null ) { final BusGroup group = neighbour . getBus ( ) ; if ( group != null ) { group . removeNeighbour ( neighbour ) ; if ( group . getMembers ( ) . length == 0 ) deleteBus ( group ) ; } removeRegisteredProxies ( neighbour , transaction , ! recoveredNeighbour ) ; try { neighbour . remove ( transaction , neighbour . getLockID ( ) ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.proxyhandler.Neighbours.removeRegisteredProxies" , "1:879:1.113" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeRegisteredProxies" , "SIResourceException" ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0003" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbours" , "1:888:1.113" , e , neighbour . getUUID ( ) } ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0003" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbours" , "1:897:1.113" , e , neighbour . getUUID ( ) } , null ) , e ) ; } if ( ! recoveredNeighbour ) { synchronized ( _neighbours ) { _neighbours . remove ( meUUID ) ; } } else { synchronized ( _recoveredNeighbours ) { _recoveredNeighbours . remove ( meUUID ) ; } } neighbour . deleteDestination ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeNeighbour" , "Neighbour Unknown" ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0005" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbours" , "1:932:1.113" , meUUID } ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0005" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbours" , "1:940:1.113" , meUUID } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeNeighbour" ) ; }
Removes a Neighbouring ME .
25,502
protected void removeRecoveredNeighbour ( SIBUuid8 neighbourUuid , Transaction transaction ) throws SIConnectionLostException , SIResourceException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeRecoveredNeighbour" , new Object [ ] { neighbourUuid , transaction } ) ; Neighbour neighbour = null ; synchronized ( _recoveredNeighbours ) { neighbour = ( Neighbour ) _recoveredNeighbours . remove ( neighbourUuid ) ; } removeRegisteredProxies ( neighbour , transaction , false ) ; neighbour . deleteDestination ( ) ; neighbour . deleteSystemDestinations ( ) ; try { neighbour . remove ( transaction , neighbour . getLockID ( ) ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.proxyhandler.Neighbours.removeNeighbour" , "1:994:1.113" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeRecoveredNeighbour" , "SIResourceException" ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0003" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbours" , "1:1003:1.113" , e , neighbour . getUUID ( ) } ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0003" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbours" , "1:1012:1.113" , e , neighbour . getUUID ( ) } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeRecoveredNeighbour" ) ; }
Removes a Neighbour that has been deleted by Admin but it existed in the MessageStore
25,503
private void removeRegisteredProxies ( Neighbour neighbour , Transaction transaction , boolean wasRecovered ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeRegisteredProxies" , new Object [ ] { neighbour , transaction , new Boolean ( wasRecovered ) } ) ; final Hashtable registeredProxies = neighbour . getRegisteredProxies ( ) ; if ( ! registeredProxies . isEmpty ( ) ) { boolean proxiesDeregistered = false ; final Enumeration subscriptions = registeredProxies . elements ( ) ; final ArrayList topics = new ArrayList ( ) ; final ArrayList topicSpaces = new ArrayList ( ) ; while ( subscriptions . hasMoreElements ( ) ) { final MESubscription subscription = ( MESubscription ) subscriptions . nextElement ( ) ; neighbour . proxyDeregistered ( subscription . getTopicSpaceUuid ( ) , subscription . getTopic ( ) , transaction ) ; DestinationHandler destination = _destinationManager . getDestinationInternal ( subscription . getTopicSpaceUuid ( ) , false ) ; final boolean deleted = deleteProxy ( destination , subscription , neighbour , subscription . getTopicSpaceUuid ( ) , subscription . getTopic ( ) , wasRecovered , true ) ; if ( deleted ) { topics . add ( subscription . getTopic ( ) ) ; topicSpaces . add ( subscription . getTopicSpaceUuid ( ) ) ; proxiesDeregistered = true ; } } if ( proxiesDeregistered && wasRecovered ) { _proxyHandler . unsubscribeEvent ( topicSpaces , topics , neighbour . getBusId ( ) , null ) ; } } else if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "no proxies registered for neighbour " + neighbour . getUUID ( ) . toString ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeRegisteredProxies" ) ; }
Removes all the proxies associated with this Neighbour .
25,504
private BusGroup findBus ( String name ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "findBus" , name ) ; for ( int i = 0 ; i < _buses . length ; ++ i ) if ( _buses [ i ] . getName ( ) . equals ( name ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "findBus" , _buses [ i ] ) ; return _buses [ i ] ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "findBus" , "null" ) ; return null ; }
Finds a Bus given its name .
25,505
private BusGroup createBus ( String busId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createBus" , busId ) ; boolean isLocalBus = busId . equals ( _localBusName ) ; final BusGroup group = new BusGroup ( busId , _proxyHandler , isLocalBus ) ; final BusGroup [ ] tempBuses = _buses ; _buses = new BusGroup [ tempBuses . length + 1 ] ; System . arraycopy ( tempBuses , 0 , _buses , 0 , tempBuses . length ) ; _buses [ tempBuses . length ] = group ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createBus" , group ) ; return group ; }
Creates a BusGroup with the given name .
25,506
private void deleteBus ( BusGroup group ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteBus" , group ) ; final BusGroup [ ] t = _buses ; for ( int i = 0 ; i < _buses . length ; i ++ ) { if ( _buses [ i ] . equals ( group ) ) { _buses = new BusGroup [ t . length - 1 ] ; if ( i > 0 ) System . arraycopy ( t , 0 , _buses , 0 , i ) ; if ( i < t . length - 1 ) System . arraycopy ( t , i + 1 , _buses , i , t . length - 1 - i ) ; break ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteBus" ) ; }
Removes the Bus with the given name from the list of all Buss .
25,507
Neighbour getRecoveredNeighbour ( SIBUuid8 neighbourUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRecoveredNeighbour" , neighbourUuid ) ; Neighbour neighbour = null ; synchronized ( _recoveredNeighbours ) { neighbour = ( Neighbour ) _recoveredNeighbours . get ( neighbourUuid ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRecoveredNeighbour" , neighbour ) ; return neighbour ; }
Gets the Recovered Neighbour based on the UUID supplied
25,508
protected boolean createProxy ( Neighbour neighbour , DestinationHandler destination , MESubscription subscription , SIBUuid12 topicSpace , String topic , boolean warmRestarted ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createProxy" , new Object [ ] { neighbour , destination , subscription , topicSpace , topic , new Boolean ( warmRestarted ) } ) ; boolean outputHandlerCreated = false ; if ( destination != null ) { PubSubOutputHandler handler = destination . getPubSubOutputHandler ( neighbour . getUUID ( ) ) ; if ( handler == null ) { handler = destination . createPubSubOutputHandler ( neighbour ) ; } handler . setTopicSpaceMapping ( subscription . getForeignTSName ( ) ) ; handler . addTopic ( topic ) ; subscription . registerForPostCommit ( _proxyHandler , destination , handler , neighbour ) ; outputHandlerCreated = true ; } else { addTopicSpaceReference ( neighbour . getUUID ( ) , topicSpace , topic , warmRestarted ) ; subscription . registerForPostCommit ( neighbour , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createProxy" , new Boolean ( outputHandlerCreated ) ) ; return outputHandlerCreated ; }
Creates the proxy based on the meName topicSpace and topic for the originating ME .
25,509
protected boolean deleteProxy ( DestinationHandler destination , MESubscription subscription , Neighbour neighbour , SIBUuid12 topicSpace , String topic , boolean wasRecovered , boolean deleteHandler ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteProxy" , new Object [ ] { destination , neighbour , subscription , topicSpace , topic } ) ; boolean outputHandlerDeleted = false ; if ( destination != null ) { PubSubOutputHandler handler = destination . getPubSubOutputHandler ( neighbour . getUUID ( ) ) ; if ( handler != null ) { handler . removeTopic ( topic ) ; if ( ! deleteHandler ) handler = null ; if ( wasRecovered ) subscription . registerForPostCommit ( _proxyHandler , destination , handler , neighbour ) ; else subscription . registerForPostCommit ( null , destination , handler , neighbour ) ; outputHandlerDeleted = true ; } else if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "PubSubOutputHandler not found" ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Destination object not found" ) ; if ( wasRecovered ) subscription . registerForPostCommit ( neighbour , this ) ; else subscription . registerForPostCommit ( null , destination , null , neighbour ) ; removeTopicSpaceReference ( neighbour . getUUID ( ) , subscription , topicSpace , topic ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteProxy" , new Boolean ( outputHandlerDeleted ) ) ; return outputHandlerDeleted ; }
Removes the reference to the PubSubOutHandler on the given topic space for the topic on the ME .
25,510
private void addSubscriptionsToBus ( BusGroup group , String busId ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addSubscriptionsToBus" , new Object [ ] { group , busId } ) ; final ArrayList cdList = _proxyHandler . getMessageProcessor ( ) . getMessageProcessorMatching ( ) . getAllCDMatchTargets ( ) ; final Iterator cdIterator = cdList . listIterator ( ) ; while ( cdIterator . hasNext ( ) ) { final ConsumerDispatcher cd = ( ConsumerDispatcher ) cdIterator . next ( ) ; group . addLocalSubscription ( cd . getConsumerDispatcherState ( ) , null , null , false ) ; } final ArrayList phList = _proxyHandler . getMessageProcessor ( ) . getMessageProcessorMatching ( ) . getAllPubSubOutputHandlerMatchTargets ( ) ; final ArrayList outputSeenList = new ArrayList ( ) ; final Iterator phIterator = phList . listIterator ( ) ; while ( phIterator . hasNext ( ) ) { final PubSubOutputHandler oh = ( PubSubOutputHandler ) phIterator . next ( ) ; if ( ! outputSeenList . contains ( oh ) && oh . neighbourOnDifferentBus ( busId ) ) { final String topics [ ] = oh . getTopics ( ) ; final SIBUuid12 topicSpaceUuid = oh . getTopicSpaceUuid ( ) ; if ( topics != null && topics . length > 0 ) { for ( int i = 0 ; i < topics . length ; i ++ ) { group . addRemoteSubscription ( topicSpaceUuid , topics [ i ] , null , false ) ; } } outputSeenList . add ( oh ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addSubscriptionsToBus" ) ; }
Adds the subscriptions to the Bus
25,511
protected void resetBusSubscriptionList ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resetBusSubscriptionList" ) ; for ( int i = 0 ; i < _buses . length ; i ++ ) { BusGroup group = _buses [ i ] ; group . reset ( ) ; try { addSubscriptionsToBus ( group , group . getName ( ) ) ; SubscriptionMessage message = group . generateResetSubscriptionMessage ( ) ; LocalTransaction transaction = _proxyHandler . getMessageProcessor ( ) . getTXManager ( ) . createLocalTransaction ( true ) ; group . sendToNeighbours ( message , ( Transaction ) transaction , true ) ; transaction . commit ( ) ; } catch ( SIException e ) { SibTr . exception ( tc , e ) ; group . resetListFailed ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resetBusSubscriptionList" ) ; }
Resets the list of subscriptions that the bus knows about .
25,512
protected JDBCDataSourceMBeanImpl setDataSourceChild ( String key , JDBCDataSourceMBeanImpl ds ) { return dataSourceMBeanChildrenList . put ( key , ds ) ; }
setDataSourceChild add a child of type JDBCDataSourceMBeanImpl to this MBean .
25,513
private ConversationContext getConversationContext ( String id ) { if ( conversationContext == null ) { synchronized ( this ) { if ( conversationContext == null ) { Container container = Container . instance ( id ) ; conversationContext = container . deploymentManager ( ) . instance ( ) . select ( HttpConversationContext . class ) . get ( ) ; } } } return conversationContext ; }
Get conversation context .
25,514
public EJSHome getStartedHome ( J2EEName beanName ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getStartedHome : " + beanName ) ; HomeRecord hr = homeOfHomes . getHomeRecord ( beanName ) ; EJSHome hi = hr . getHomeAndInitialize ( ) ; if ( hi == null ) { String msgTxt = "The " + beanName . getComponent ( ) + " bean in the " + beanName . getModule ( ) + " module of the " + beanName . getApplication ( ) + " application has been stopped and may no longer be used." + " Wait for the bean to be started, and then try again." ; throw new EJBStoppedException ( msgTxt ) ; } return hi ; }
Gets a home by name .
25,515
EJSWrapperCommon getHomeWrapperCommon ( J2EEName beanName ) throws CSIException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getHomeWrapperCommon : " + beanName ) ; EJSHome hi = getStartedHome ( beanName ) ; EJSWrapperCommon result ; try { result = hi . getWrapper ( ) ; } catch ( CSIException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".getHomeWrapperCommon" , "740" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "CSIException occurred" , ex ) ; throw ex ; } catch ( RemoteException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".getHomeWrapperCommon" , "745" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Remote Exception occurred" , ex ) ; throw new CSIException ( "failed to get home instance" , ex ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getHomeWrapperCommon : " + result ) ; return result ; }
Return the local home named beanName .
25,516
public void stopBean ( BeanMetaData bmd ) throws CSIException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "stopBean : " + bmd . j2eeName ) ; try { uninstallBean ( bmd , false ) ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".stopBean" , "876" , this ) ; throw new CSIException ( "Stop on bean " + bmd . j2eeName + " failed" , ex ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "stopBean" ) ; }
Stop the bean instance specified by the beanName . ManagedContainer wrapper around uninstallBean
25,517
public EJSHome startBean ( BeanMetaData bmd ) throws ContainerException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "startBean: " + bmd . j2eeName ) ; J2EEName homeKey = bmd . j2eeName ; EJSHome ejsHome = null ; try { internalBeanMetaDataStore . put ( homeKey , bmd ) ; bmd . dump ( ) ; ejsHome = homeOfHomes . create ( bmd ) ; ejsHome . initialize ( this , new BeanId ( homeOfHomes , homeKey , true ) , bmd ) ; homeOfHomes . setActivationStrategy ( ejsHome , bmd ) ; ejsHome . completeInitialization ( ) ; if ( bmd . persister != null ) { bmd . persister . setHome ( ejsHome ) ; } } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".startBean" , "1126" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Caught exception" , ex ) ; if ( ejsHome != null ) { try { ejsHome . destroy ( ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".startBean" , "1831" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Caught exception destroying home" , t ) ; } } String msgTxt = "Failed to start " + homeKey ; throw new ContainerException ( msgTxt , ex ) ; } ejsHome . homeRecord . homeInternal = ejsHome ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "startBean" ) ; return ejsHome ; }
Registers the bean with the container and creates enables and returns the home instance .
25,518
public ContainerTx getCurrentTx ( SynchronizationRegistryUOWScope uowId , boolean isLocal ) throws CSITransactionRolledbackException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getCurrentTx (" + ContainerTx . uowIdToString ( uowId ) + ", " + ( isLocal ? "local" : "global" ) + ")" ) ; ContainerTx result = null ; SynchronizationRegistryUOWScope currTxKey = uowId ; if ( currTxKey != null ) { result = ( ContainerTx ) currTxKey . getResource ( containerTxResourceKey ) ; if ( result == null ) { result = ivEJBRuntime . createContainerTx ( this , ! isLocal , currTxKey , uowCtrl ) ; try { uowCtrl . enlistWithTransaction ( currTxKey , result ) ; } catch ( CSIException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".getCurrentTx" , "1305" , this ) ; uowCtrl . setRollbackOnly ( ) ; throw new CSITransactionRolledbackException ( "Enlistment with transaction failed" , ex ) ; } currTxKey . putResource ( containerTxResourceKey , result ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getCurrentTx : " + result ) ; return result ; }
d139352 - 2
25,519
public ContainerAS getCurrentSessionalUOW ( boolean checkMarkedReset ) throws CSIException , CSITransactionRolledbackException { ContainerAS result = null ; Object currASKey = uowCtrl . getCurrentSessionalUOW ( checkMarkedReset ) ; if ( currASKey == null ) { return null ; } result = containerASMap . get ( currASKey ) ; if ( result == null ) { result = new ContainerAS ( this , currASKey ) ; uowCtrl . enlistWithSession ( result ) ; containerASMap . put ( currASKey , result ) ; } return result ; }
Added checMarkedRest parameter . d348420
25,520
public static EJBThreadData getUserTransactionThreadData ( ) { EJBThreadData threadData = getThreadData ( ) ; BeanO beanO = threadData . getCallbackBeanO ( ) ; if ( beanO == null ) { EJBException ex = new EJBException ( "EJB UserTransaction can only be used from an EJB" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getUserTransactionThreadData: " + ex ) ; throw ex ; } try { beanO . getUserTransaction ( ) ; } catch ( IllegalStateException ex ) { EJBException ex2 = new EJBException ( "EJB UserTransaction cannot be used: " + ex , ex ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getUserTransactionThreadData: " + beanO + ": " + ex2 ) ; throw ex2 ; } return threadData ; }
Returns the EJB thread data if an EJB context is active on the current thread and that EJB may use UserTransaction .
25,521
public void processTxContextChange ( EJBThreadData threadData , boolean isLocal ) throws RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "processTxContextChange (" + isLocal + ")" ) ; SynchronizationRegistryUOWScope uowId = uowCtrl . getCurrentTransactionalUOW ( true ) ; ContainerTx tx = getCurrentTx ( uowId , isLocal ) ; EJSDeployedSupport s = threadData . getMethodContext ( ) ; if ( s != null && ! threadData . isLifeCycleMethodTransactionActive ( ) ) { s . currentTx = tx ; s . uowCookie . setTransactionalUOW ( uowId ) ; if ( s . ivRunUnderUOW > 0 ) { s . resetCurrentTx = true ; } if ( ! isLocal ) { EJBMethodInfoImpl methodInfo = s . methodInfo ; String taskName = methodInfo . getBeanClassName ( ) + "." + methodInfo . getMethodName ( ) ; ivUOWManager . putResource ( "com.ibm.websphere.profile" , taskName ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Set JPA task name: " + taskName ) ; } } } if ( isTraceOn && TETxLifeCycleInfo . isTraceEnabled ( ) ) { String idStr ; if ( isLocal ) { if ( uowId != null ) { idStr = "" + System . identityHashCode ( uowId ) ; TETxLifeCycleInfo . traceLocalTxBegin ( idStr , "Local Tx Begin" ) ; } } else { idStr = uowId . toString ( ) ; int idx ; idStr = ( idStr != null ) ? ( ( ( idx = idStr . indexOf ( "(" ) ) != - 1 ) ? idStr . substring ( idx + 1 , idStr . indexOf ( ")" ) ) : ( ( idx = idStr . indexOf ( "tid=" ) ) != - 1 ) ? idStr . substring ( idx + 4 ) : idStr ) : "NoTx" ; TETxLifeCycleInfo . traceUserTxBegin ( idStr , "User Tx Begin" ) ; } } if ( tx != null ) { BeanO beanO = threadData . getCallbackBeanO ( ) ; UserTransactionEnabledContext utxBeanO = ( UserTransactionEnabledContext ) beanO ; if ( utxBeanO . getModuleVersion ( ) == BeanMetaData . J2EE_EJB_VERSION_1_1 ) { tx . setIsolationLevel ( utxBeanO . getIsolationLevel ( ) ) ; } if ( utxBeanO . enlist ( tx ) ) { activator . enlistBean ( tx , beanO ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processTxContextChange" ) ; }
LIDB1181 . 23 . 5 . 1 For BMT beans userTransction calls may transition the bean back and forth between local and global transactions . This method provides a means to create the new ContainerTx and and associate it with the EJSDeployedSupport object for the method invocation
25,522
boolean transitionToStickyGlobalTran ( BeanId beanId , ContainerTx currentTx , ContainerTx expectedTx ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "transitionToStickyGlobalTran (" + beanId + "," + currentTx + ", " + expectedTx + ")" ) ; ContainerTx resumedTx = null ; EJSDeployedSupport s = getMethodContext ( ) ; EJBMethodInfoImpl methodInfo = s . methodInfo ; BeanMetaData bmd = beanId . getBeanMetaData ( ) ; try { currentTx . postInvoke ( s ) ; uowCtrl . postInvoke ( beanId , s . uowCookie , s . exType , methodInfo ) ; s . uowCtrlPreInvoked = false ; s . currentTx = null ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "transitionToStickyGlobalTran : local tx completed" ) ; s . uowCookie = uowCtrl . preInvoke ( beanId , methodInfo ) ; s . uowCtrlPreInvoked = true ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "transitionToStickyGlobalTran : sticky global resumed" ) ; boolean isLocal = s . uowCookie . isLocalTx ( ) ; SynchronizationRegistryUOWScope UOWid = s . uowCookie . getTransactionalUOW ( ) ; resumedTx = getCurrentTx ( UOWid , isLocal ) ; s . currentTx = resumedTx ; resumedTx . preInvoke ( s ) ; int isolationLevel = methodInfo . isolationAttr ; if ( bmd . ivModuleVersion <= BeanMetaData . J2EE_EJB_VERSION_1_1 || ( bmd . ivModuleVersion >= BeanMetaData . J2EE_EJB_VERSION_2_0 && bmd . cmpVersion == InternalConstants . CMP_VERSION_1_X ) ) { resumedTx . setIsolationLevel ( isolationLevel ) ; } s . currentIsolationLevel = isolationLevel ; } catch ( RemoteException rex ) { FFDCFilter . processException ( rex , CLASS_NAME + ".getBean" , "1542" , this ) ; throw ExceptionUtil . EJBException ( "A failure occured resuming a bean managed transaction" , rex ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "transitionToStickyGlobalTran : " + ( resumedTx == expectedTx ) ) ; return resumedTx == expectedTx ; }
d671368 d671368 . 1
25,523
public int getIsolationLevel ( int preferred ) { int isolationLevel ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getIsolationLevel: " + preferred ) ; ContainerTx ctx = null ; try { ctx = getCurrentTx ( false ) ; } catch ( CSITransactionRolledbackException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".getIsolationLevel" , "1614" ) ; Tr . error ( tc , "IGNORING_UNEXPECTED_EXCEPTION_CNTR0033E" , ex ) ; } if ( ctx == null ) { if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "ContainerTx is null, returning specified default" ) ; isolationLevel = preferred ; } else { isolationLevel = ctx . getIsolationLevel ( ) ; if ( isolationLevel == java . sql . Connection . TRANSACTION_NONE ) { if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "Using specified default" ) ; isolationLevel = preferred ; try { ctx . setIsolationLevel ( isolationLevel ) ; } catch ( IsolationLevelChangeException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".getIsolationLevel" , "1645" ) ; Tr . error ( tc , "IGNORING_UNEXPECTED_EXCEPTION_CNTR0033E" , ex ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getIsolationLevel: " + MethodAttribUtils . getIsolationLevelString ( isolationLevel ) ) ; return isolationLevel ; }
d128344 . 1
25,524
public void removeBean ( BeanO beanO ) throws CSITransactionRolledbackException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "removeBean with BeanO" ) ; BeanId id = beanO . getId ( ) ; if ( id != null ) { try { ContainerTx currentTx = getCurrentTx ( false ) ; if ( currentTx . delist ( beanO ) ) { activator . removeBean ( currentTx , beanO ) ; } else { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "BeanO not enlisted - not removed from tx or cache" ) ; } } catch ( Throwable th ) { FFDCFilter . processException ( th , CLASS_NAME + ".removeBean(BeanO)" , "1949" , this ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "Exception thrown in removeBean()" , new Object [ ] { beanO , th } ) ; } } else { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "BeanId is null" ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeBean" ) ; }
Remove bean from container in current transaction context . Used to clean up from create failures . It is not an error if the bean does not exist in this container .
25,525
public boolean removeStatefulBean ( Object bean ) throws RemoteException , RemoveException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "removeStatefulBean : " + Util . identity ( bean ) ) ; EJSWrapperBase wrapper = null ; if ( bean instanceof EJSWrapperBase ) { wrapper = ( EJSWrapperBase ) bean ; } else if ( bean instanceof LocalBeanWrapper ) { wrapper = EJSWrapperCommon . getLocalBeanWrapperBase ( ( LocalBeanWrapper ) bean ) ; } else { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeStatefulBean : RemoveException:" + Util . identity ( bean ) ) ; throw new RemoveException ( "Object to remove is not an enterprise bean reference : " + Util . identity ( bean ) ) ; } if ( ! isStatefulSessionBean ( wrapper . beanId ) ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeStatefulBean : RemoveException:not stateful : " + wrapper . beanId ) ; throw new RemoveException ( "Object to remove is not a stateful bean reference : " + wrapper . beanId ) ; } try { removeBean ( wrapper ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeStatefulBean : true" ) ; return true ; } catch ( NoSuchEJBException ex ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeStatefulBean : false (NoSuchEJBException)" ) ; return false ; } catch ( NoSuchObjectLocalException ex ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeStatefulBean : false (NoSuchObjectLocalException)" ) ; return false ; } catch ( OBJECT_NOT_EXIST ex ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeStatefulBean : false (OBJECT_NOT_EXIST)" ) ; return false ; } catch ( EJBException ex ) { if ( ex . getCause ( ) instanceof RemoveException ) { RemoveException rex = ( RemoveException ) ex . getCause ( ) ; throw rex ; } throw ex ; } }
F743 - 29185
25,526
public static Object resolveWrapperProxy ( EJSLocalWrapperProxy proxy ) { WrapperProxyState state = proxy . ivState ; Object wrapper = state . ivWrapper ; if ( wrapper == null ) { do { state = state . reconnect ( ) ; wrapper = state . ivWrapper ; } while ( wrapper == null ) ; proxy . ivState = state ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "resolveWrapperProxy: " + state ) ; } return wrapper ; }
Resolves the wrapper for a local object wrapper proxy .
25,527
private EJBMethodInfoImpl mapMethodInfo ( EJSDeployedSupport s , EJSWrapperBase wrapper , int methodId , String methodSignature ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "mapMethodInfo(" + methodId + "," + methodSignature + ")" ) ; EJBMethodInfoImpl rtnInfo = null ; s . methodId = methodId ; s . ivWrapper = wrapper ; if ( methodId < 0 ) { if ( methodId == MID_BUSINESS_REMOVE ) { rtnInfo = s . ivThreadData . getEJBMethodInfoStack ( ) . get ( "$remove:" , null , wrapper , wrapper . ivInterface == WrapperInterface . BUSINESS_LOCAL ? MethodInterface . LOCAL : MethodInterface . REMOTE , wrapper . bmd . usesBeanManagedTx ? TransactionAttribute . TX_BEAN_MANAGED : TransactionAttribute . TX_NOT_SUPPORTED ) ; rtnInfo . setClassLoader = true ; } else { rtnInfo = ivEntityHelper . getPMMethodInfo ( s , wrapper , methodId , methodSignature ) ; } } else { if ( wrapper . methodInfos == null ) throw new IllegalStateException ( "An attempt was made to invoke a method on a bean interface that is not defined." ) ; rtnInfo = wrapper . methodInfos [ methodId ] ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "mapMethodInfo" ) ; return rtnInfo ; }
d140003 . 20 return signature change
25,528
final public boolean doesJaccNeedsEJBArguments ( EJSWrapperBase wrapper ) { EJBSecurityCollaborator < ? > securityCollaborator = ivSecurityCollaborator ; boolean result = securityCollaborator != null && securityCollaborator . areRequestMethodArgumentsRequired ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "doesJaccNeedsEJBArguments returning " + result ) ; return result ; }
d209070 rewrote method .
25,529
public EnterpriseBean preInvoke ( EJSWrapperBase wrapper , int methodId , EJSDeployedSupport s , Object [ ] args ) throws RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; EJBMethodInfoImpl methodInfo = mapMethodInfo ( s , wrapper , methodId , null ) ; try { if ( isTraceOn ) { if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) TEEJBInvocationInfo . tracePreInvokeBegins ( s , wrapper ) ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "EJBpreInvoke(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" ) ; if ( tcClntInfo . isDebugEnabled ( ) ) Tr . debug ( tcClntInfo , "preInvoke(" + methodInfo . getMethodName ( ) + ")" ) ; } Object bean = null ; if ( methodInfo . isStatelessSessionBean && methodInfo . isHomeCreate ) { bean = preInvokeForStatelessSessionCreate ( wrapper , methodId , s , methodInfo , args ) ; } else { bean = preInvokeActivate ( wrapper , methodId , s , methodInfo ) ; preInvokeAfterActivate ( wrapper , bean , s , args ) ; } if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) { ContainerTx containerTx = s . currentTx ; Tr . exit ( tc , "EJBpreInvoke(" + methodId + ":" + methodInfo . getMethodName ( ) + ") " + " Invoking method '" + methodInfo . getMethodName ( ) + "' on bean '" + wrapper . getClass ( ) . getName ( ) + "(" + wrapper . beanId + ")" + "', '" + containerTx + "', isGlobalTx=" + ( containerTx != null ? ( containerTx . isTransactionGlobal ( ) ? "true" : "false" ) : "Unknown" ) ) ; } if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) TEEJBInvocationInfo . tracePreInvokeEnds ( s , wrapper ) ; } return ( EnterpriseBean ) bean ; } catch ( Throwable t ) { preinvokeHandleException ( t , wrapper , methodId , s , methodInfo ) ; return null ; } }
LIDB2617 . 11 added this method .
25,530
public EnterpriseBean preInvoke ( EJSWrapperBase wrapper , int methodId , EJSDeployedSupport s , EJBMethodInfoImpl methodInfo ) throws RemoteException { s . methodId = methodId ; s . ivWrapper = wrapper ; return preInvokePmInternal ( wrapper , methodId , s , methodInfo ) ; }
This method is called LinkTargetHelper . getLink when PM wants to provide AccessIntent to use for ejbLink processing . When this method is called the methodId should be in the negative range to indicate this is a special method with the method signature passed in . This method signature is then used to create the EJSMethodInfo in mapMethodInfo call . The method signature is in the form defined in BeanMetaData . java .
25,531
public EnterpriseBean preInvoke ( EJSWrapperBase wrapper , int methodId , EJSDeployedSupport s , String methodSignature ) throws RemoteException { EJBMethodInfoImpl methodInfo = mapMethodInfo ( s , wrapper , methodId , methodSignature ) ; return preInvokePmInternal ( wrapper , methodId , s , methodInfo ) ; }
This method is called by the generated code to support PMgr home finder methods . When this method is called the methodId should be in the negative range to indicate this is a special method with the method signature passed in . This method signature is then used to create the EJSMethodInfo in mapMethodInfo call . The method signature is in the form defined in BeanMetaData . java .
25,532
private void preInvokeAfterActivate ( EJSWrapperBase wrapper , Object bean , EJSDeployedSupport s , Object [ ] args ) throws RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; s . ivEJBMethodArguments = args ; if ( ! s . isLightweight ) { try { EJBSecurityCollaborator < ? > securityCollaborator = this . ivSecurityCollaborator ; if ( securityCollaborator != null && s . methodId > - 1 ) { s . securityCookie = notifySecurityCollaboratorPreInvoke ( securityCollaborator , s ) ; s . ivSecurityCollaborator = securityCollaborator ; } if ( ivAfterActivationCollaborators != null ) { for ( int i = 0 ; i < ivAfterActivationCollaborators . length ; i ++ ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "preInvokeAfterActivate : Invoking AfterActivationCollaborator.preInvoke method on: " + ivAfterActivationCollaborators [ i ] . getClass ( ) . getName ( ) ) ; Object cookie = ivAfterActivationCollaborators [ i ] . preInvoke ( s ) ; if ( cookie != null ) { if ( s . ivAfterActivationCookies == null ) { s . ivAfterActivationCookies = new Object [ ivAfterActivationCollaborators . length ] ; } s . ivAfterActivationCookies [ i ] = cookie ; } s . ivAfterActivationPreInvoked ++ ; } } } catch ( RuntimeException ex ) { throw ex ; } catch ( CSIException ex ) { throw ex ; } catch ( Exception ex ) { throw new CSIException ( "" , ex ) ; } } if ( isZOS ) { DispatchEventListenerCookie [ ] dispatchEventListenerCookies = s . ivDispatchEventListenerCookies ; if ( dispatchEventListenerCookies != null ) { this . ivDispatchEventListenerManager . callDispatchEventListeners ( DispatchEventListener . BEFORE_EJBMETHOD , dispatchEventListenerCookies , s . methodInfo ) ; } } }
LIDB2617 . 11
25,533
private Object notifySecurityCollaboratorPreInvoke ( EJBSecurityCollaborator < ? > collaborator , EJBRequestData request ) throws CSIException { try { return collaborator . preInvoke ( request ) ; } catch ( EJBAccessException ex ) { CSIAccessException csiEx = new CSIAccessException ( ex . getMessage ( ) ) ; csiEx . setStackTrace ( ex . getStackTrace ( ) ) ; throw csiEx ; } catch ( RuntimeException ex ) { throw ex ; } catch ( CSIException ex ) { throw ex ; } catch ( Exception ex ) { throw new CSIException ( "" , ex ) ; } }
Notify the security collaborator for pre - invoke . This method handles exception mapping for EJBSecurityCollaborator that throw EJBAccessException rather than the legacy CSIAccessException .
25,534
public void preInvokeForLifecycleInterceptors ( LifecycleInterceptorWrapper wrapper , int methodId , EJSDeployedSupport s , BeanO beanO ) throws RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; EJBThreadData threadData = s . ivThreadData ; EJBMethodInfoImpl methodInfo = mapMethodInfo ( s , wrapper , methodId , null ) ; if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "preInvokeForLifecycleInterceptors(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" ) ; if ( tcClntInfo . isDebugEnabled ( ) ) Tr . debug ( tcClntInfo , "preInvoke(" + methodInfo . getMethodName ( ) + ")" ) ; } BeanMetaData bmd = wrapper . bmd ; s . methodInfo = methodInfo ; s . ivCallerContext = threadData . pushMethodContext ( s ) ; threadData . ivComponentMetaDataContext . beginContext ( bmd ) ; threadData . pushCallbackBeanO ( beanO ) ; s . beanO = beanO ; s . ivPopCallbackBeanORequired = true ; s . oldClassLoader = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( bmd . ivContextClassLoader ) ; try { s . uowCookie = uowCtrl . preInvoke ( wrapper . beanId , methodInfo ) ; s . uowCtrlPreInvoked = true ; s . currentTx = getCurrentTx ( s . uowCookie . getTransactionalUOW ( ) , false ) ; s . currentTx . preInvoke ( s ) ; s . currentIsolationLevel = methodInfo . isolationAttr ; EJBSecurityCollaborator < ? > securityCollaborator = ivSecurityCollaborator ; if ( securityCollaborator != null ) { s . securityCookie = notifySecurityCollaboratorPreInvoke ( securityCollaborator , s ) ; s . ivSecurityCollaborator = securityCollaborator ; } if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) { ContainerTx containerTx = s . currentTx ; Tr . exit ( tc , "preInvokeForLifecycleInterceptors(" + methodId + ":" + methodInfo . getMethodName ( ) + ") " + " Invoking method '" + methodInfo . getMethodName ( ) + "' on bean '" + wrapper . getClass ( ) . getName ( ) + "(" + wrapper . beanId + ")" + "', '" + containerTx + "', isGlobalTx=" + ( containerTx != null ? ( containerTx . isTransactionGlobal ( ) ? "true" : "false" ) : "Unknown" ) ) ; } if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) TEEJBInvocationInfo . tracePreInvokeEnds ( s , wrapper ) ; } } catch ( Throwable t ) { preinvokeHandleException ( t , wrapper , methodId , s , methodInfo ) ; } }
A subset of preInvoke specifically for the lifecycle interceptors of a Singleton Session bean . This method must be paired with a call to postInvokeForLifecycleInterceptors .
25,535
void postInvokePopCallbackContexts ( EJSDeployedSupport s ) { if ( s . ivPopCallbackBeanORequired ) { s . ivThreadData . popCallbackBeanO ( ) ; BeanO beanO = s . beanO ; if ( beanO != null ) { BeanMetaData bmd = beanO . home . beanMetaData ; if ( bmd . type == InternalConstants . TYPE_STATELESS_SESSION || bmd . type == InternalConstants . TYPE_MESSAGE_DRIVEN ) { try { beanO . returnToPool ( ) ; } catch ( RemoteException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".postInvoke" , "359" , this ) ; } } } } s . ivThreadData . ivComponentMetaDataContext . endContext ( ) ; }
Pop contexts from the thread for the callback bean .
25,536
private void postInvokeRolledbackException ( EJSDeployedSupport s , CSITransactionRolledbackException ex ) throws RemoteException { if ( ( ! s . ivBeginnerSetRollbackOnly && ( ! s . began || s . exType != ExceptionType . CHECKED_EXCEPTION ) ) || s . methodInfo . ivInterface == MethodInterface . TIMED_OBJECT ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "postInvoke: transaction rollback in finally" , ex ) ; if ( s . currentTx != null && s . currentTx . ivPostProcessingException != null ) { s . getExceptionMappingStrategy ( ) . setUncheckedException ( s , s . currentTx . ivPostProcessingException ) ; ex . detail = s . getRootCause ( ) ; } else if ( ex . detail == null ) { ex . detail = s . getRootCause ( ) ; } else { Throwable exceptionToUse = s . getRootCause ( ) ; if ( exceptionToUse == null ) { s . rootEx = s . getExceptionMappingStrategy ( ) . findRootCause ( ex . detail ) ; } else { ex . detail = exceptionToUse ; } } Exception crex = s . mapCSITransactionRolledBackException ( ex ) ; if ( crex instanceof RemoteException ) throw ( RemoteException ) crex ; else if ( crex instanceof RuntimeException ) throw ( RuntimeException ) crex ; } }
Called by postInvoke methods when CSIRolledbackException is caught from UOWControl . postInvoke .
25,537
public void postInvokeForLifecycleInterceptors ( LifecycleInterceptorWrapper wrapper , int methodId , EJSDeployedSupport s ) throws RemoteException { EJBMethodInfoImpl methodInfo = s . methodInfo ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn ) { if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) TEEJBInvocationInfo . tracePostInvokeBegins ( s , wrapper ) ; if ( tcClntInfo . isDebugEnabled ( ) ) Tr . debug ( tcClntInfo , "postInvoke(" + methodInfo . getMethodName ( ) + ")" ) ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "postInvokeForLifecycleInterceptors(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" ) ; } if ( s . resetCurrentTx ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "s.currentTx may be invalid; reset" ) ; s . currentTx = getCurrentContainerTx ( ) ; } s . currentTx . postInvoke ( s ) ; try { boolean isRollbackOnly = uowCtrl . getRollbackOnly ( ) ; try { if ( s . began && s . currentTx . ivPostInvokeContext == null ) { s . currentTx . ivPostInvokeContext = s ; } uowCtrl . postInvoke ( wrapper . beanId , s . uowCookie , s . exType , methodInfo ) ; } catch ( CSITransactionRolledbackException ex ) { postInvokeRolledbackException ( s , ex ) ; } if ( methodId == LifecycleInterceptorWrapper . MID_POST_CONSTRUCT && isRollbackOnly ) { String msg = "setRollbackOnly called from within a singleton post construct method." ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , msg ) ; throw new EJBTransactionRolledbackException ( msg ) ; } } finally { if ( ! s . began || s . currentTx . ivPostInvokeContext != null ) { postInvokePopCallbackContexts ( s ) ; } if ( s . ivSecurityCollaborator != null ) { notifyPostInvoke ( s . ivSecurityCollaborator , s , s . securityCookie ) ; } if ( s . currentTx != null && s . began ) { s . currentTx . releaseResources ( ) ; s . currentTx = null ; } EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( s . oldClassLoader ) ; s . ivThreadData . popMethodContext ( ) ; if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "postInvokeForLifecycleInterceptors(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" + ( ( s . ivException != null ) ? ( "**** throws " + s . ivException ) : "" ) ) ; } } }
A subset of postInvoke specifically for the lifecycle interceptors of a Singleton Session bean . This method must be paired with preInvokeForLifecycleInterceptors .
25,538
public static ClassLoader getClassLoader ( J2EEName beanName ) { ClassLoader cl = null ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getClassLoader(" + beanName + ")" ) ; HomeInternal hi = homeOfHomes . getHome ( beanName ) ; if ( hi != null ) { cl = hi . getClassLoader ( ) ; } else { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . exit ( tc , "getClassLoader: Home not found!" ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getClassLoader: " + cl ) ; return cl ; }
Get the ClassLoader for the bean specified by beanName
25,539
public Object preInvokeORBDispatch ( Object object , String operation ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) { String objStr = null ; if ( object != null ) objStr = object . getClass ( ) . getName ( ) ; Tr . debug ( tc , "preInvokeORBDispatch(" + objStr + ", " + operation + ")" ) ; } EJBThreadData threadData = null ; if ( object instanceof javax . rmi . CORBA . Tie ) { object = ( ( javax . rmi . CORBA . Tie ) object ) . getTarget ( ) ; if ( object instanceof EJSWrapperBase ) { final EJSWrapperBase wrapper = ( EJSWrapperBase ) object ; BeanMetaData bmd = wrapper . bmd ; if ( bmd != null ) { threadData = svThreadData . get ( ) ; threadData . pushClassLoader ( bmd ) ; } } } return threadData ; }
This method is driven when dispatch is called upon a server request . It should return a cookie Object which uniquely identifies this preinvoke . This cookie should be passed as a paramater when the corresponding postinvoke is called .
25,540
public void postInvokeORBDispatch ( Object object ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "postInvokeORBDispatch: " + ( object != null ) ) ; if ( object != null ) { ( ( EJBThreadData ) object ) . popClassLoader ( ) ; } }
This method is driven just before the server side interceptors are driven for a server response .
25,541
public EJBHome getEJBHome ( J2EEName name ) throws ContainerEJBException { try { EJSWrapperCommon wrapperCommon = getHomeWrapperCommon ( name ) ; EJSWrapper wrapper = wrapperCommon . getRemoteWrapper ( ) ; return ( EJBHome ) PortableRemoteObject . toStub ( wrapper ) ; } catch ( RemoteException re ) { FFDCFilter . processException ( re , CLASS_NAME + ".getEJBHome" , "2955" , this ) ; if ( re . detail == null ) { throw new ContainerEJBException ( "Could not get EJBHome" , re ) ; } else { throw new ContainerEJBException ( "Could not get EJBHome" , re . detail ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".getEJBHome" , "2967" , this ) ; throw new ContainerEJBException ( "Could not get EJBHome" , t ) ; } }
Returns a reference to the EJBHome associated with a specified J2EEName .
25,542
public EJBLocalHome getEJBLocalHome ( J2EEName name ) throws ContainerEJBException { try { EJSWrapperCommon wrapperCommon = getHomeWrapperCommon ( name ) ; return ( EJBLocalHome ) wrapperCommon . getLocalObject ( ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".getEJBLocalHome" , "2993" , this ) ; throw new ContainerEJBException ( "Could not get EJBLocalHome" , t ) ; } }
Returns a reference to the EJBLocalHome associated with a specified J2EEName .
25,543
public void setPreferredCacheSize ( long size ) { int intSize = ( int ) size ; activator . setCachePreferredMaxSize ( intSize ) ; wrapperManager . setWrapperCacheSize ( 2 * intSize ) ; }
Set the cache size used by this container .
25,544
public Class < ? > getEJBPrimaryKeyClass ( J2EEName j2eeName ) { Class < ? > rtnPKeyClass = null ; BeanMetaData bmd = internalBeanMetaDataStore . get ( j2eeName ) ; if ( bmd != null ) { rtnPKeyClass = bmd . pKeyClass ; } return rtnPKeyClass ; }
Returns the primary key class associated to the input j2eeName or null if j2eeName or primary key is not specified .
25,545
public Object invokeProceed ( EJSDeployedSupport s , Method businessMethod , Object bean , Object [ ] methodParameters , boolean parametersModified ) throws Exception { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "EJBinvokeProceed(" + s . methodId + ":" + s . methodInfo . getMethodName ( ) + ")" ) ; if ( parametersModified ) { s . ivEJBMethodArguments = methodParameters ; if ( doesJaccNeedsEJBArguments ( null ) && s . ivSecurityCollaborator != null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "invoking EJBSecurityCollaborator.argumentsUpdated" ) ; notifySecurityCollaboratorArgumentsUpdated ( s . ivSecurityCollaborator , s ) ; } } Object returnValue = businessMethod . invoke ( bean , methodParameters ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "EJBinvokeProceed(" ) . append ( s . methodId ) . append ( ":" ) ; sb . append ( s . methodInfo . getMethodName ( ) ) . append ( ") returning " ) ; if ( returnValue == null ) { sb . append ( "null" ) ; } else { sb . append ( returnValue . getClass ( ) . getName ( ) ) ; sb . append ( "@" ) . append ( returnValue . hashCode ( ) ) ; } Tr . exit ( tc , sb . toString ( ) ) ; } return returnValue ; }
LIDB3294 - 41
25,546
public String serverName ( ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "serverName" , new Object [ ] { this , _serverName } ) ; return _serverName ; }
Returns the name of the server represented by the managed failure scope .
25,547
public void registerTransaction ( TransactionImpl tran , boolean recovered ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerTransaction" , new Object [ ] { this , tran , recovered } ) ; if ( isConcurrent ) _transactions . add ( tran ) ; if ( ! isConcurrent || recovered ) { synchronized ( this ) { if ( ! isConcurrent ) _transactions . add ( tran ) ; if ( recovered ) { _recoveryManager . registerTransaction ( tran ) ; } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerTransaction" ) ; }
This method is called to register the creation of a new transaction associated with the managed failure scope .
25,548
public void deregisterTransaction ( TransactionImpl tran , boolean recovered ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "deregisterTransaction" , new Object [ ] { this , tran , recovered } ) ; if ( isConcurrent ) _transactions . remove ( tran ) ; if ( ! isConcurrent || recovered ) { synchronized ( this ) { if ( ! isConcurrent ) _transactions . remove ( tran ) ; if ( recovered ) { _recoveryManager . deregisterTransaction ( tran ) ; } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deregisterTransaction" ) ; }
This method is called to register the completion of a transaction associated with the managed failure scope .
25,549
public void setFormatString ( String format ) { this . stringFormat = format ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Set access format to " + format ) ; } parseFormat ( ) ; }
Set the access log format to a String
25,550
private AccessLogRecordData toAccessLogRecordData ( final HttpRequestMessage request , final HttpResponseMessage response , final String version , final String userId , final String remoteAddr , final long numBytes ) { final HttpRequestMessage request2 = request ; final HttpResponseMessage response2 = response ; final long timestamp ; final long startTime ; final long elapsedTime ; final String localIP ; final String localPort ; timestamp = System . currentTimeMillis ( ) ; startTime = AccessLogStartTime . getStartTime ( response2 , request2 , null ) ; elapsedTime = AccessLogElapsedRequestTime . getElapsedRequestTime ( response2 , request2 , null ) ; localIP = AccessLogLocalIP . getLocalIP ( response2 , request2 , null ) ; localPort = AccessLogLocalPort . getLocalPort ( response2 , request2 , null ) ; AccessLogRecordData recordData = new AccessLogRecordData ( ) { public long getTimestamp ( ) { return timestamp ; } public String getVersion ( ) { return version ; } public String getUserId ( ) { return userId ; } public HttpResponseMessage getResponse ( ) { return response2 ; } public HttpRequestMessage getRequest ( ) { return request2 ; } public String getRemoteAddress ( ) { return remoteAddr ; } public long getBytesWritten ( ) { return numBytes ; } public long getStartTime ( ) { return startTime ; } public long getElapsedTime ( ) { return elapsedTime ; } public String getLocalIP ( ) { return localIP ; } public String getLocalPort ( ) { return localPort ; } } ; return recordData ; }
Return a AccessLogRecordData instance
25,551
protected ResourceAdapterMBeanImpl setResourceAdapterChild ( String key , ResourceAdapterMBeanImpl ra ) { return raMBeanChildrenList . put ( key , ra ) ; }
setResourceAdapterChild add a child of type ResourceAdapterMBeanImpl to this MBean .
25,552
private synchronized void addedLoginModule ( ) { boolean changedEntries = false ; synchronized ( pendingContextEntryRefs ) { Iterator < ServiceReference < JAASLoginContextEntry > > i = pendingContextEntryRefs . iterator ( ) ; while ( i . hasNext ( ) ) { ServiceReference < JAASLoginContextEntry > contextEntryRef = i . next ( ) ; String [ ] entryModulePids = ( String [ ] ) contextEntryRef . getProperty ( JAASLoginContextEntryImpl . CFG_KEY_LOGIN_MODULE_REF ) ; if ( haveAllModules ( entryModulePids ) ) { i . remove ( ) ; jaasLoginContextEntries . putReference ( ( String ) contextEntryRef . getProperty ( KEY_ID ) , contextEntryRef ) ; changedEntries = true ; } } } if ( changedEntries ) { modified ( properties ) ; } }
Iterate through pending context entries find any entries that are now satisfied and move them to the main list .
25,553
private SIBusMessage _receiveNoWait ( SITransaction tran ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIErrorException , SINotAuthorizedException , SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_receiveNoWait" ) ; SIBusMessage mess = null ; boolean consumeSuccessful = false ; if ( isReadAhead ) { try { mess = proxyQueue . receiveNoWait ( tran ) ; } catch ( MessageDecodeFailedException mdfe ) { FFDCFilter . processException ( mdfe , CLASS_NAME + "._receiveNoWait" , CommsConstants . CONSUMERSESSIONPROXY_RCVNOWAIT_01 , this ) ; SIResourceException resourceException = new SIResourceException ( nls . getFormattedMessage ( "UNABLE_TO_CREATE_JSMESSAGE_SICO1002" , null , null ) ) ; resourceException . initCause ( mdfe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "receiveNoWait" , resourceException ) ; throw resourceException ; } } else { mess = performReceive ( - 1 , tran ) ; } consumeSuccessful = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_receiveNoWait" ) ; return mess ; }
This private version of receiveNoWait just simply processes the receive request without doing any checking on the state of the connection session or transaction and without getting any locks needed . This method should be called by a method that does do this .
25,554
private void _close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_close" ) ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_CLOSE_CONSUMER_SESS , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_CLOSE_CONSUMER_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 ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_close" ) ; }
Sends a close flow to the peer .
25,555
public void close ( boolean closingConnection ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , closingConnection ) ; if ( executingOnCallbackThread ( ) ) { callbackThreadState = CallbackThreadState . CLOSED ; } else { synchronized ( callbackLock ) { boolean closeProxyQueue = false ; synchronized ( synchLock ) { if ( ( state != StateEnum . CLOSED ) && ( state != StateEnum . CLOSING ) ) { state = StateEnum . CLOSING ; if ( proxyQueue != null ) closeProxyQueue = true ; else { state = StateEnum . CLOSED ; if ( ! closingConnection && ! isClosed ( ) ) { _close ( ) ; if ( currentOrderingContext != null ) { currentOrderingContext . decrementUseCount ( ) ; currentOrderingContext = null ; } } } } } if ( closeProxyQueue ) proxyQueue . closing ( ) ; synchronized ( synchLock ) { if ( state == StateEnum . CLOSING ) { state = StateEnum . CLOSED ; if ( ! closingConnection && proxyQueue != null ) { proxyQueue . closed ( ) ; if ( currentOrderingContext != null ) { currentOrderingContext . decrementUseCount ( ) ; currentOrderingContext = null ; } } } } } } getConnectionProxy ( ) . consumerClosedNotification ( getProxyID ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
Closes the consumer session .
25,556
public void close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; close ( false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
Closes the ConsumerSession . Any subsequent attempt to call methods on the ConsumerSession will be ignored .
25,557
private void _deleteSet ( SIMessageHandle [ ] msgHandles , SITransaction tran ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIIncorrectCallException , SIMessageNotLockedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_deleteSet" , new Object [ ] { msgHandles . length + " msg handles" , tran } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) ) { CommsLightTrace . traceMessageIds ( tc , "DeleteSetMsgTrace" , msgHandles ) ; } CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; request . putSITransaction ( tran ) ; request . putSIMessageHandles ( msgHandles ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_DELETE_SET , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_DELETE_SET_R ) ; 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_SIIncorrectCallException ( reply , err ) ; checkFor_SIMessageNotLockedException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_deleteSet" ) ; }
Used to delete a set of messages .
25,558
public void activateAsynchConsumer ( boolean deliveryImmediately ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "activateAsynchConsumer" , "" + deliveryImmediately ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "activateAsynchConsumer" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "CLIENT_METHOD_INVALID_SICO1021" , new Object [ ] { "activateAsynchConsumer" } , null ) ) ; }
This method is designed to drive an async consumer once and once only if it can be driven . However this is not supported remotely and so calling this method will result in an SICommsException .
25,559
public long getId ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getId" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getId" , "" + messageProcessorId ) ; return messageProcessorId ; }
This method returns the id for this consumer session that was assigned to it by the message processor on the server . This is needed when creating a bifurcated consumer session .
25,560
public void deliverAsyncException ( Throwable e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deliverAsyncException" , e ) ; if ( proxyQueue != null ) { proxyQueue . deliverException ( e ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "** Odd - we are not async?!" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deliverAsyncException" ) ; }
This method is used when an asynchronous exception occurs and we want to send a message to any associated exception listeners on this connection .
25,561
protected final void setLevel ( int traceLevel ) { switch ( traceLevel ) { case Trace . Level_All : debugEnabled = true ; eventEnabled = true ; entryEnabled = true ; break ; case Trace . Level_Entry : debugEnabled = false ; eventEnabled = false ; entryEnabled = true ; break ; case Trace . Level_Debug : debugEnabled = true ; eventEnabled = false ; entryEnabled = false ; break ; case Trace . Level_Event : debugEnabled = false ; eventEnabled = true ; entryEnabled = false ; break ; case Trace . Level_None : debugEnabled = false ; eventEnabled = false ; entryEnabled = false ; break ; default : } }
Enable tracing of this component .
25,562
public void afterCompletion ( int status ) { if ( status == Status . STATUS_COMMITTED ) controller . notifyOfTaskAssignment ( partitionId , taskId , expectedExecTime , binaryFlags , txTimeout ) ; }
Upon successful transaction commit automatically schedules a task via the controller .
25,563
public static final void appendState ( StringBuilder sb , short bits ) { if ( ( bits & TaskState . SCHEDULED . bit ) != 0 ) sb . append ( TaskState . SCHEDULED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . ENDED . bit ) != 0 ) sb . append ( TaskState . ENDED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . SUSPENDED . bit ) != 0 ) sb . append ( TaskState . SUSPENDED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . UNATTEMPTED . bit ) != 0 ) sb . append ( TaskState . UNATTEMPTED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . SKIPPED . bit ) != 0 ) sb . append ( TaskState . SKIPPED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . SKIPRUN_FAILED . bit ) != 0 ) sb . append ( TaskState . SKIPRUN_FAILED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . FAILURE_LIMIT_REACHED . bit ) != 0 ) sb . append ( TaskState . FAILURE_LIMIT_REACHED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . CANCELED . bit ) != 0 ) sb . append ( TaskState . CANCELED . name ( ) ) . append ( ',' ) ; sb . deleteCharAt ( sb . length ( ) - 1 ) ; }
Prints a state .
25,564
public static final String normalizeString ( String str ) { return ( str == null || str . length ( ) == 0 ) ? " " : str ; }
Normalizes an empty or a null string into a space string .
25,565
@ SuppressWarnings ( "unchecked" ) public Collection < EsaResource > findMatchingEsas ( String searchString , ProductDefinition definition , Visibility visible ) throws RepositoryException { Collection < ? extends RepositoryResource > resources = findResources ( searchString , Collections . singleton ( definition ) , Collections . singleton ( ResourceType . FEATURE ) , visible ) ; return ( Collection < EsaResource > ) resources ; }
Find the features that match the supplied search string ProductDefinition and Visibility
25,566
public Collection < ProductResource > getMatchingAddons ( ProductDefinition definition ) throws RepositoryBackendException { @ SuppressWarnings ( "unchecked" ) Collection < ProductResourceImpl > addonList = ( Collection < ProductResourceImpl > ) getAllResources ( ResourceType . ADDON ) ; Collection < ProductResource > matchedAddons = new ArrayList < ProductResource > ( ) ; for ( ProductResourceImpl addon : addonList ) { if ( addon . matches ( definition ) == MatchResult . MATCHED ) { matchedAddons . add ( addon ) ; } } return matchedAddons ; }
This will obtain the addons from the repository that match the specified product definition
25,567
public Collection < RepositoryResource > getMatchingResources ( final FilterPredicate ... predicates ) throws RepositoryBackendException { Collection < RepositoryResource > resources = cycleThroughRepositories ( new RepositoryInvoker < RepositoryResource > ( ) { public Collection < RepositoryResource > performActionOnRepository ( RepositoryConnection connection ) throws RepositoryBackendException { return connection . getMatchingResources ( predicates ) ; } } ) ; return resources ; }
Returns all resources which match the supplied set of FilterPredicate objects .
25,568
public Collection < ? extends RepositoryResource > getAllResourcesWithDupes ( ) throws RepositoryBackendException { Collection < RepositoryResource > resources = cycleThroughRepositoriesWithDupes ( new RepositoryInvoker < RepositoryResource > ( ) { @ SuppressWarnings ( "unchecked" ) public Collection < RepositoryResource > performActionOnRepository ( RepositoryConnection connection ) throws RepositoryBackendException { return ( Collection < RepositoryResource > ) connection . getAllResourcesWithDupes ( ) ; } } ) ; return resources ; }
This method gets all the resources in this list of repositories this list may contain dupes if the same asset is found in multiple repositories .
25,569
public Collection < ? extends RepositoryResource > getAllResources ( LicenseType licenseType , ResourceType type ) throws RepositoryBackendException { Collection < ? extends RepositoryResource > allResources = getAllResources ( type ) ; if ( licenseType != null ) { Collection < RepositoryResource > licensedResources = new ArrayList < RepositoryResource > ( ) ; for ( RepositoryResource resource : getAllResources ( type ) ) { if ( licenseType . equals ( resource . getLicenseType ( ) ) ) { licensedResources . add ( resource ) ; } } return licensedResources ; } else { return allResources ; } }
Gets all resources of the specified type and license type from the repositories .
25,570
@ SuppressWarnings ( "unchecked" ) public Collection < EsaResource > getAllFeatures ( ) throws RepositoryBackendException { return ( Collection < EsaResource > ) getAllResources ( ResourceType . FEATURE ) ; }
This methods returns a list of all features in the supplied repositories
25,571
@ SuppressWarnings ( "unchecked" ) public Collection < ProductResourceImpl > getAllProducts ( LicenseType licenseType ) throws RepositoryBackendException { Collection < ProductResourceImpl > product = ( Collection < ProductResourceImpl > ) getAllResources ( licenseType , ResourceType . INSTALL ) ; Collection < ProductResourceImpl > addons = ( Collection < ProductResourceImpl > ) getAllResources ( licenseType , ResourceType . ADDON ) ; product . addAll ( addons ) ; return product ; }
Get all products with a given license type
25,572
private static int getOpenPort ( ) throws IOException { Log . info ( c , "getOpenPort" , "Entry." ) ; ServerSocket s = new ServerSocket ( 0 ) ; Log . info ( c , "getOpenPort" , "Got socket." ) ; int port = s . getLocalPort ( ) ; Log . info ( c , "getOpenPort" , "Got port " + s ) ; s . close ( ) ; Log . info ( c , "getOpenPort" , "Close socket" ) ; return port ; }
Get a free port .
25,573
public void add ( Entry entry ) throws LdapException { CoreSession session = this . service . getAdminSession ( ) ; session . add ( entry ) ; }
Convenience method to add an entry using the admin session .
25,574
public Partition addPartition ( String partitionId , String partitionDn ) throws Exception { Log . info ( c , "addPartition" , "entry " + partitionId + " " + partitionDn ) ; JdbmPartition partition = new JdbmPartition ( this . service . getSchemaManager ( ) ) ; partition . setId ( partitionId ) ; partition . setPartitionPath ( new File ( this . service . getInstanceLayout ( ) . getPartitionsDirectory ( ) , partitionId ) . toURI ( ) ) ; partition . setSuffixDn ( new Dn ( partitionDn ) ) ; service . addPartition ( partition ) ; Log . info ( c , "addPartition" , "exit" ) ; return partition ; }
Add a new partition to the server
25,575
private void initSchemaPartition ( ) throws Exception { final InstanceLayout instanceLayout = this . service . getInstanceLayout ( ) ; final File schemaPartitionDirectory = new File ( instanceLayout . getPartitionsDirectory ( ) , "schema" ) ; if ( schemaPartitionDirectory . exists ( ) ) { System . out . println ( "schema partition already exists, skipping schema extraction" ) ; } else { final SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor ( instanceLayout . getPartitionsDirectory ( ) ) ; extractor . extractOrCopy ( ) ; } final SchemaLoader loader = new LdifSchemaLoader ( schemaPartitionDirectory ) ; final SchemaManager schemaManager = new DefaultSchemaManager ( loader ) ; schemaManager . loadAllEnabled ( ) ; final List < Throwable > errors = schemaManager . getErrors ( ) ; if ( errors . size ( ) != 0 ) { throw new Exception ( I18n . err ( I18n . ERR_317 , Exceptions . printErrors ( errors ) ) ) ; } this . service . setSchemaManager ( schemaManager ) ; final LdifPartition schemaLdifPartition = new LdifPartition ( schemaManager ) ; schemaLdifPartition . setPartitionPath ( schemaPartitionDirectory . toURI ( ) ) ; final SchemaPartition schemaPartition = new SchemaPartition ( schemaManager ) ; schemaPartition . setWrappedPartition ( schemaLdifPartition ) ; this . service . setSchemaPartition ( schemaPartition ) ; }
initialize the schema manager and add the schema partition to diectory service
25,576
public void stopService ( ) throws Exception { Log . info ( c , "stopService" , "Stopping LdapServer" ) ; this . server . stop ( ) ; Log . info ( c , "stopService" , "Stopping DirectoryService" ) ; service . shutdown ( ) ; Log . info ( c , "stopService" , "Ldap stopped." ) ; }
Stop the LdapServer and the Directory service . Use for JUnit teardown . If the service is not stopped then future instances with the same name cannot clean up the file directory .
25,577
public void complete ( VirtualConnection vc , TCPReadRequestContext rsc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "complete() called: vc=" + vc ) ; } HttpOutboundServiceContextImpl osc = ( HttpOutboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPOSC ) ; osc . markReadCancelFailure ( ) ; int state ; synchronized ( osc . stateSyncObject ) { state = osc . getReadState ( ) ; osc . setCallbackState ( HttpOutboundServiceContextImpl . CALLBACK_STATE_COMPLETE , null ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Read-ahead state: " + state ) ; } switch ( state ) { case ( HttpOutboundServiceContextImpl . READ_STATE_IDLE ) : IOException ioe = new IOException ( "Unexpected read complete" ) ; osc . getAppReadCallback ( ) . error ( vc , ioe ) ; break ; case ( HttpOutboundServiceContextImpl . READ_STATE_TIME_RESET ) : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Error: Read-ahead completed after init() call." ) ; } osc . setCallbackState ( HttpOutboundServiceContextImpl . CALLBACK_STATE_ERROR , new IOException ( "Invalid read-ahead data" ) ) ; break ; case ( HttpOutboundServiceContextImpl . READ_STATE_SYNC ) : osc . wakeupReadAhead ( ) ; break ; case ( HttpOutboundServiceContextImpl . READ_STATE_ASYNC ) : HttpOSCReadCallback . getRef ( ) . complete ( vc , rsc ) ; break ; default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected read-ahead state: " + state ) ; } break ; } }
If the read completes with data then this method will be called . It then depends on what state the actual connection is in on what should happen next .
25,578
public void error ( VirtualConnection vc , TCPReadRequestContext rsc , IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "error() called: vc=" + vc + " ioe=" + ioe ) ; } HttpOutboundServiceContextImpl osc = ( HttpOutboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPOSC ) ; if ( osc . markReadCancelSuccess ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Ignoring error callback on canceled read" ) ; } return ; } int state ; synchronized ( osc . stateSyncObject ) { state = osc . getReadState ( ) ; osc . setCallbackState ( HttpOutboundServiceContextImpl . CALLBACK_STATE_ERROR , ioe ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Read-ahead state: " + state ) ; } switch ( state ) { case ( HttpOutboundServiceContextImpl . READ_STATE_IDLE ) : osc . getAppReadCallback ( ) . error ( vc , ioe ) ; break ; case ( HttpOutboundServiceContextImpl . READ_STATE_TIME_RESET ) : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Received the read-ahead immed timeout." ) ; } break ; case ( HttpOutboundServiceContextImpl . READ_STATE_SYNC ) : osc . wakeupReadAhead ( ) ; break ; case ( HttpOutboundServiceContextImpl . READ_STATE_ASYNC ) : osc . setPersistent ( false ) ; osc . reConnect ( vc , ioe ) ; break ; default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected read-ahead state: " + state ) ; } break ; } }
If an error occurs such as the server side closing down the socket then this method will be called . Depending on what state the connection is in this error is either sent to the application channel immediately or delayed until the actual read for the response would start when it can then hand the error off to the application channel .
25,579
public static String dumpTree ( Event event , boolean includeContextInfo ) { return new EventStackFormatter ( ) . getStackFormat ( event , includeContextInfo ) . toString ( ) ; }
This method is used to dump the event in Tree structure . Currently used for Request Timing where it will keep a log of timing of request execution in case it exceeds it will call this method and dump the tree of Request Dumping would be for log file or into Fight Data Recorder
25,580
public SourcedValue getSourced ( ) { boolean fromCache = true ; int cacheVersion = stampedValue . getStamp ( ) ; int latestVersion = parentContainer . getMasterVersion ( ) ; String key = parentContainer . getKey ( ) ; SourcedValue sourcedValue = null ; if ( cacheVersion != latestVersion ) { SourcedValue currentValue = stampedValue . getReference ( ) ; SourcedValue newValue = config . getSourcedValue ( type , key ) ; if ( stampedValue . compareAndSet ( currentValue , newValue , cacheVersion , latestVersion ) ) { sourcedValue = newValue ; fromCache = false ; } } if ( fromCache ) { sourcedValue = stampedValue . getReference ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { if ( sourcedValue != null ) { Tr . debug ( tc , "get: Key={0}, Value={1}" , key , sourcedValue ) ; } else { Tr . debug ( tc , "get: Key={0} not found" , key ) ; } } return sourcedValue ; }
Fetch the latest version of the property . If not up to date then resolve to the latest value inline .
25,581
private ThreadContextDescriptor appendInflowContext ( ) throws WorkCompletedException { ThreadContextDescriptor merged = threadContextDescriptor . clone ( ) ; Set < String > inflowContext = new HashSet < String > ( ) ; if ( workContexts != null ) for ( WorkContext workContext : workContexts ) if ( workContext instanceof HintsContext ) { if ( hintsContextSetupFailure != null ) throw contextSetupFailure ( workContext , WorkContextErrorCodes . CONTEXT_SETUP_FAILED , hintsContextSetupFailure ) ; } else { JCAContextProvider provider = bootstrapContext . getJCAContextProvider ( workContext . getClass ( ) ) ; if ( provider == null ) throw contextSetupFailure ( workContext , WorkContextErrorCodes . UNSUPPORTED_CONTEXT_TYPE , null ) ; else { ThreadContext context ; try { context = provider . getInflowContext ( workContext , executionProperties ) ; } catch ( Throwable x ) { throw contextSetupFailure ( workContext , WorkContextErrorCodes . CONTEXT_SETUP_FAILED , x ) ; } String workContextProviderName = bootstrapContext . getJCAContextProviderName ( workContext . getClass ( ) ) ; if ( ! inflowContext . add ( workContextProviderName ) ) throw contextSetupFailure ( workContext , WorkContextErrorCodes . DUPLICATE_CONTEXTS , null ) ; merged . set ( workContextProviderName , context ) ; } } if ( executionContext != null ) if ( inflowContext . isEmpty ( ) && ( executionContext . getXid ( ) != null || executionContext . getTransactionTimeout ( ) != WorkManager . UNKNOWN ) ) { JCAContextProvider provider = bootstrapContext . getJCAContextProvider ( TransactionContext . class ) ; if ( provider == null ) throw contextSetupFailure ( executionContext , WorkContextErrorCodes . UNSUPPORTED_CONTEXT_TYPE , null ) ; ThreadContext context ; try { context = provider . getInflowContext ( executionContext , executionProperties ) ; } catch ( Throwable x ) { throw contextSetupFailure ( executionContext , WorkContextErrorCodes . CONTEXT_SETUP_FAILED , x ) ; } String executionContextHandlerName = bootstrapContext . getJCAContextProviderName ( TransactionContext . class ) ; merged . set ( executionContextHandlerName , context ) ; } return merged ; }
Append work inflow context to the captured thread context .
25,582
private WorkCompletedException contextSetupFailure ( Object context , String errorCode , Throwable cause ) { if ( context instanceof WorkContextLifecycleListener ) ( ( WorkContextLifecycleListener ) context ) . contextSetupFailed ( errorCode ) ; String message = null ; if ( WorkContextErrorCodes . DUPLICATE_CONTEXTS . equals ( errorCode ) ) message = Utils . getMessage ( "J2CA8624.work.context.duplicate" , bootstrapContext . resourceAdapterID , context . getClass ( ) . getName ( ) ) ; else if ( WorkContextErrorCodes . UNSUPPORTED_CONTEXT_TYPE . equals ( errorCode ) ) message = Utils . getMessage ( "J2CA8625.work.context.unavailable" , bootstrapContext . resourceAdapterID , context . getClass ( ) . getName ( ) ) ; else if ( cause != null ) message = cause . getMessage ( ) ; WorkCompletedException wcex = new WorkCompletedException ( message , errorCode ) ; if ( cause != null ) wcex . initCause ( cause ) ; return wcex ; }
Handle a work context setup failure .
25,583
public void run ( ) { JCASecurityContext ctx = bootstrapContext . getJCASecurityContext ( ) ; if ( ctx != null ) ctx . runInInboundSecurityContext ( work ) ; else work . run ( ) ; }
When this is invoked the work is running with context on the thread .
25,584
Long waitForStart ( ) throws InterruptedException , WorkRejectedException { long timeout = startTimeout == WorkManager . UNKNOWN ? WorkManager . INDEFINITE : startTimeout < fudgeFactor ? fudgeFactor : startTimeout ; Object o = startupDurationQueue . poll ( timeout , TimeUnit . MILLISECONDS ) ; if ( o instanceof WorkRejectedException ) throw ( WorkRejectedException ) o ; else return ( Long ) o ; }
Waits for the work to start .
25,585
public static FacesInitializer getFacesInitializer ( ServletContext context ) { FacesInitializer initializer = _getFacesInitializerFromInitParam ( context ) ; if ( initializer == null ) { initializer = _getDefaultFacesInitializer ( context ) ; } return initializer ; }
Gets the FacesInitializer for the system .
25,586
private static FacesInitializer _getFacesInitializerFromInitParam ( ServletContext context ) { String initializerClassName = context . getInitParameter ( FACES_INITIALIZER_PARAM ) ; if ( initializerClassName != null ) { try { Class < ? > clazz = ClassUtils . classForName ( initializerClassName ) ; if ( ! FacesInitializer . class . isAssignableFrom ( clazz ) ) { throw new FacesException ( "Class " + clazz + " does not implement FacesInitializer" ) ; } return ( FacesInitializer ) ClassUtils . newInstance ( clazz ) ; } catch ( ClassNotFoundException cnfe ) { throw new FacesException ( "Could not find class of specified FacesInitializer" , cnfe ) ; } } return null ; }
Gets a FacesInitializer from the web . xml config param .
25,587
public BaseDestinationHandler getDestination ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getDestination" ) ; SibTr . exit ( tc , "getDestination" , _baseDestHandler ) ; } return _baseDestHandler ; }
Get the BaseDestinationHandler object to which this CD belongs
25,588
public SIBUuid8 getUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getUuid" ) ; SibTr . exit ( tc , "getUuid" , _cmUuid ) ; } return _cmUuid ; }
Get the Uuid for this consumer manager .
25,589
public ConsumerKeyGroup joinKeyGroup ( ConsumerKey consumerKey , OrderingContextImpl orderingGroup ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "joinKeyGroup" , new Object [ ] { consumerKey , orderingGroup } ) ; JSKeyGroup keyGroup = null ; synchronized ( orderingGroup ) { synchronized ( _baseDestHandler . getReadyConsumerPointLock ( ) ) { if ( ( keyGroup = keyGroups . get ( orderingGroup ) ) == null ) { JSConsumerSet consumerSet = null ; if ( consumerKey instanceof ConsumableKey ) { consumerSet = ( ( ConsumableKey ) consumerKey ) . getConsumerSet ( ) ; keyGroup = createConsumerKeyGroup ( consumerSet ) ; if ( keyGroup != null ) keyGroups . put ( orderingGroup , keyGroup ) ; } } } if ( keyGroup != null ) ( ( ConsumableKey ) consumerKey ) . joinKeyGroup ( keyGroup ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "joinKeyGroup" , keyGroup ) ; return keyGroup ; }
Add the supplied consumerKey to a keyGroup create the keyGroup if required
25,590
public void removeKeyGroup ( LocalQPConsumerKeyGroup keyGroup ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeKeyGroup" , keyGroup ) ; synchronized ( _baseDestHandler . getReadyConsumerPointLock ( ) ) { Iterator keys = keyGroups . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { Object key = keys . next ( ) ; if ( keyGroups . get ( key ) . equals ( keyGroup ) ) keys . remove ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeKeyGroup" ) ; }
Remove the keyGroup from the CD this occurs when the last member is removed from the group
25,591
void parseHeader ( String header , Set < String > packages ) { if ( header != null && header . length ( ) > 0 ) { List < String > splitPackages = new ArrayList < String > ( ) ; int lastIndex = 0 ; boolean inQuotedSection = false ; int i = 0 ; for ( i = 0 ; i < header . length ( ) ; i ++ ) { if ( ( header . charAt ( i ) == ',' ) && ! ( inQuotedSection ) ) { String packagePlusAttributesAndDirectives = header . substring ( lastIndex , i ) ; lastIndex = i + 1 ; splitPackages . add ( packagePlusAttributesAndDirectives ) ; } else if ( header . charAt ( i ) == '"' ) { inQuotedSection = ! inQuotedSection ; } } splitPackages . add ( header . substring ( lastIndex , i ) ) ; for ( String packagePlusAttributesAndDirectives : splitPackages ) { String [ ] bits = packagePlusAttributesAndDirectives . split ( ";" ) ; packages . add ( bits [ 0 ] ) ; } } }
This algorithm is nuts . Bnd has a nice on in OSGIHeader .
25,592
public static void addShutdownHook ( final Thread shutdownHook ) { Object token = ThreadIdentityManager . runAsServer ( ) ; try { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { public Void run ( ) { Runtime . getRuntime ( ) . addShutdownHook ( shutdownHook ) ; return null ; } } ) ; } finally { ThreadIdentityManager . reset ( token ) ; } }
Add a shutdown hook as a privileged action .
25,593
public synchronized AnnotationHelper getAnnotationHelper ( ) { if ( aHelper == null ) { this . aHelper = new AnnotationHelper ( wApp ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getAnnotationHelper" , "created new annotation helper instance + this . aHelper + "]" ) ; } } return aHelper ; }
Retrieves an AnnotationHelper instance .
25,594
protected void unsetItemInterface ( ServiceReference < ItemInterface > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . entry ( tc , "unsetItemInterface" , ref ) ; itemInterfaceRef . setReference ( ref ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exit ( tc , "unsetItemInterface" ) ; }
Declarative Services method for unsetting the ItemInterface service reference .
25,595
public static AbstractItem getItemStreamInstance ( String itemClassName ) { AbstractItem itemStream = itemInterfaceRef . getService ( ) . getItemStreamInstance ( itemClassName ) ; ; return itemStream ; }
Static method for getting the ItemStream instance from the runtime .
25,596
public void busReloaded ( Object newBus , boolean busChanged , boolean destChg , boolean medChg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "busReloaded" ) ; SibTr . exit ( this , tc , "busReloaded" ) ; } }
Notification that the configuration of the bus has changed .
25,597
public void commitPreparedTransaction ( String xid ) throws TransactionException , PersistenceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "commitPreparedTransaction" , xid ) ; if ( _manager != null ) { try { PersistentTranId pid = new PersistentTranId ( xid ) ; _manager . commit ( pid , false ) ; } catch ( ArrayIndexOutOfBoundsException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Invalid XID string" , xid ) ; throw new XidInvalidException ( nls . getString ( "INVALID_XID_STRING_SIMS1010" ) ) ; } catch ( StringIndexOutOfBoundsException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Invalid XID string" , xid ) ; throw new XidInvalidException ( nls . getString ( "INVALID_XID_STRING_SIMS1010" ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commitPreparedTransaction" ) ; return ; }
Commit the given transaction . Given a string representing an xid create a PersistentTranId from it and then request the XidManager to commit it . Part of MBean interface for resolving in - doubt transactions .
25,598
public void dump ( FormattedWriter fw ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dump" ) ; try { xmlRequestWriteOnFile ( fw ) ; } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught writing Mmessage store dump!" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dump" ) ; }
Dump message store dynamic diagnostic information .
25,599
public void dump ( FormattedWriter fw , String arg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dump" , arg ) ; if ( arg != null ) { if ( arg . equalsIgnoreCase ( "raw" ) ) { dumpRaw ( fw ) ; } else if ( arg . equalsIgnoreCase ( "all" ) ) { dumpAll ( fw ) ; } else { dump ( fw ) ; } } else { dump ( fw ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dump" ) ; }
Dump message store . This method is called from the Messaging Engine MBean .