idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
159,800
|
private boolean sendMessage ( SIBusMessage sibMessage , boolean lastMsg , Integer priority ) throws MessageEncodeFailedException , IncorrectMessageTypeException , MessageCopyFailedException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendMessage" , new Object [ ] { sibMessage , lastMsg , priority } ) ; boolean ok = false ; // If we are at FAP9 or above we can do a 'chunked' send of the message in seperate // slices to make life easier on the Java memory manager final HandshakeProperties props = getConversation ( ) . getHandshakeProperties ( ) ; if ( props . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_9 ) { ok = sendChunkedMessage ( sibMessage , lastMsg , priority ) ; } else { ok = sendEntireMessage ( sibMessage , null , lastMsg , priority ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendMessage" , ok ) ; return ok ; }
|
Method to perform a single send of a message to the client .
| 272
| 13
|
159,801
|
private boolean sendEntireMessage ( SIBusMessage sibMessage , List < DataSlice > messageSlices , boolean lastMsg , Integer priority ) throws MessageEncodeFailedException , IncorrectMessageTypeException , MessageCopyFailedException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendEntireMessage" , new Object [ ] { sibMessage , messageSlices , lastMsg , priority } ) ; if ( lastMsg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending last in batch" ) ; } ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; // Flag to indicate a Comms error so that we stop sending messages boolean ok = true ; try { CommsServerByteBuffer byteBuffer = poolManager . allocate ( ) ; int msgLen = 0 ; short msgFlags = CommsConstants . ASYNC_START_OR_MID_BATCH ; if ( lastMsg ) msgFlags |= CommsConstants . ASYNC_LAST_IN_BATCH ; byteBuffer . putShort ( convState . getConnectionObjectId ( ) ) ; byteBuffer . putShort ( mainConsumer . getClientSessionId ( ) ) ; byteBuffer . putShort ( msgFlags ) ; byteBuffer . putShort ( mainConsumer . getMessageBatchNumber ( ) ) ; // BIT16 Message Batch // Put the entire message into the buffer in whatever way is suitable if ( messageSlices == null ) { msgLen = byteBuffer . putMessage ( ( JsMessage ) sibMessage , convState . getCommsConnection ( ) , getConversation ( ) ) ; } else { msgLen = byteBuffer . putMessgeWithoutEncode ( messageSlices ) ; } int jfapPriority = JFapChannelConstants . getJFAPPriority ( priority ) ; getConversation ( ) . send ( byteBuffer , JFapChannelConstants . SEG_ASYNC_MESSAGE , 0 , // No request number jfapPriority , false , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".sendEntireMessage" , CommsConstants . CATASYNCHCONSUMER_SENDENTIREMESS_01 , this ) ; ok = false ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2017" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendEntireMessage" , ok ) ; return ok ; }
|
Sends the message in one big buffer . If the messageSlices parameter is not null then the message has already been encoded and does not need to be done again . This may be in the case where the message was destined to be sent in chunks but is so small that it does not seem worth it .
| 640
| 63
|
159,802
|
public void consumerSessionStopped ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "consumerSessionStopped" ) ; // Inform the main consumer instance that message processor has stopped the session, this will prevent any more // restart requests from the client starting the consumer session by mistake, instead we must wait for a start // request from the application. mainConsumer . stopStoppableSession ( ) ; //471642 ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; CommsServerByteBuffer buffer = poolManager . allocate ( ) ; // Put conversation id buffer . putShort ( convState . getConnectionObjectId ( ) ) ; // Put session id buffer . putShort ( getClientSessionId ( ) ) ; try { getConversation ( ) . send ( buffer , JFapChannelConstants . SEG_ASYNC_SESSION_STOPPED_NOREPLY , 0 , JFapChannelConstants . PRIORITY_MEDIUM , false , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".consumerSessionStopped" , CommsConstants . CATASYNCHCONSUMER_SENSSION_STOPPED_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2017" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "consumerSessionStopped" ) ; }
|
Method called when the asynchronous consumer has been stopped duee to the maxSequentialFailures threshold being reached
| 415
| 21
|
159,803
|
private void checkObjectFactoryAttributes ( ResourceInjectionBinding resourceBinding , ObjectFactoryInfo extensionFactory ) // d675976 throws InjectionConfigurationException { Resource resourceAnnotation = resourceBinding . getAnnotation ( ) ; if ( ! extensionFactory . isAttributeAllowed ( "authenticationType" ) ) { checkObjectFactoryAttribute ( resourceBinding , "authenticationType" , resourceAnnotation . authenticationType ( ) , AuthenticationType . CONTAINER ) ; } if ( ! extensionFactory . isAttributeAllowed ( "shareable" ) ) { checkObjectFactoryAttribute ( resourceBinding , "shareable" , resourceAnnotation . shareable ( ) , true ) ; } }
|
Check attributes for registered ObjectFactory s .
| 146
| 8
|
159,804
|
private Reference createExtensionFactoryReference ( ObjectFactoryInfo extensionFactory , ResourceInjectionBinding resourceBinding ) // F48603.9 { String className = extensionFactory . getObjectFactoryClass ( ) . getName ( ) ; Reference ref = new Reference ( resourceBinding . getInjectionClassTypeName ( ) , className , null ) ; if ( extensionFactory . isRefAddrNeeded ( ) ) // F48603 { ref . add ( new ResourceInfoRefAddr ( createResourceInfo ( resourceBinding ) ) ) ; } return ref ; }
|
Creates a Reference for a binding from a registered ObjectFactory .
| 120
| 13
|
159,805
|
private ResourceInfo createResourceInfo ( ResourceInjectionBinding resourceBinding ) // F48603.9 { J2EEName j2eeName = ivNameSpaceConfig . getJ2EEName ( ) ; Resource resourceAnnotation = resourceBinding . getAnnotation ( ) ; return new ResourceInfo ( j2eeName == null ? null : j2eeName . getApplication ( ) , j2eeName == null ? null : j2eeName . getModule ( ) , // TODO: This should be j2eeName.getComponent(), but at least // SIP is known to improperly depend on this being the module // name without ".war". ivNameSpaceConfig . getDisplayName ( ) , resourceBinding . getJndiName ( ) , resourceBinding . getInjectionClassTypeName ( ) , resourceAnnotation . authenticationType ( ) , resourceAnnotation . shareable ( ) , resourceBinding . ivLink , getResourceRefConfig ( resourceBinding , resourceBinding . getJndiName ( ) , null ) ) ; }
|
Creates a ResourceInfo for a binding .
| 229
| 9
|
159,806
|
public HttpURLConnection createConnection ( TLSClientParameters tlsClientParameters , Proxy proxy , URL url ) throws IOException { HttpURLConnection connection = ( HttpURLConnection ) ( proxy != null ? url . openConnection ( proxy ) : url . openConnection ( ) ) ; if ( HTTPS_URL_PROTOCOL_ID . equals ( url . getProtocol ( ) ) ) { if ( tlsClientParameters == null ) { tlsClientParameters = new TLSClientParameters ( ) ; } Exception ex = null ; try { decorateWithTLS ( tlsClientParameters , connection ) ; } catch ( Exception e ) { ex = e ; } finally { if ( ex != null ) { if ( ex instanceof IOException ) { throw ( IOException ) ex ; } // use exception.initCause(ex) to be java 5 compatible IOException ioException = new IOException ( "Error while initializing secure socket" ) ; ioException . initCause ( ex ) ; throw ioException ; } } } return connection ; }
|
Create a HttpURLConnection proxified if necessary .
| 219
| 11
|
159,807
|
public static List < Parameter > collectConstructorParameters ( Class < ? > cls , Components components , javax . ws . rs . Consumes classConsumes ) { if ( cls . isLocalClass ( ) || ( cls . isMemberClass ( ) && ! Modifier . isStatic ( cls . getModifiers ( ) ) ) ) { return Collections . emptyList ( ) ; } List < Parameter > selected = Collections . emptyList ( ) ; int maxParamsCount = 0 ; for ( Constructor < ? > constructor : cls . getDeclaredConstructors ( ) ) { if ( ! ReflectionUtils . isConstructorCompatible ( constructor ) && ! ReflectionUtils . isInject ( Arrays . asList ( constructor . getDeclaredAnnotations ( ) ) ) ) { continue ; } final Type [ ] genericParameterTypes = constructor . getGenericParameterTypes ( ) ; final Annotation [ ] [ ] annotations = constructor . getParameterAnnotations ( ) ; int paramsCount = 0 ; final List < Parameter > parameters = new ArrayList < Parameter > ( ) ; for ( int i = 0 ; i < genericParameterTypes . length ; i ++ ) { final List < Annotation > tmpAnnotations = Arrays . asList ( annotations [ i ] ) ; if ( isContext ( tmpAnnotations ) ) { paramsCount ++ ; } else { final Type genericParameterType = genericParameterTypes [ i ] ; final List < Parameter > tmpParameters = collectParameters ( genericParameterType , tmpAnnotations , components , classConsumes ) ; if ( tmpParameters . size ( ) >= 1 ) { for ( Parameter tmpParameter : tmpParameters ) { if ( ParameterProcessor . applyAnnotations ( tmpParameter , genericParameterType , tmpAnnotations , components , classConsumes == null ? new String [ 0 ] : classConsumes . value ( ) , null ) != null ) { parameters . add ( tmpParameter ) ; } } paramsCount ++ ; } } } if ( paramsCount >= maxParamsCount ) { maxParamsCount = paramsCount ; selected = parameters ; } } return selected ; }
|
Collects constructor - level parameters from class .
| 456
| 9
|
159,808
|
public static List < Parameter > collectFieldParameters ( Class < ? > cls , Components components , javax . ws . rs . Consumes classConsumes ) { final List < Parameter > parameters = new ArrayList < Parameter > ( ) ; for ( Field field : ReflectionUtils . getDeclaredFields ( cls ) ) { final List < Annotation > annotations = Arrays . asList ( field . getAnnotations ( ) ) ; final Type genericType = field . getGenericType ( ) ; parameters . addAll ( collectParameters ( genericType , annotations , components , classConsumes ) ) ; } return parameters ; }
|
Collects field - level parameters from class .
| 138
| 9
|
159,809
|
public static String [ ] splitContentValues ( String [ ] strings ) { final Set < String > result = new LinkedHashSet < String > ( ) ; for ( String string : strings ) { if ( string . isEmpty ( ) ) continue ; String [ ] splitted = string . trim ( ) . split ( "," ) ; for ( String string2 : splitted ) { result . add ( string2 ) ; } } return result . toArray ( new String [ result . size ( ) ] ) ; }
|
Splits the provided array of strings into an array using comma as the separator . Also removes leading and trailing whitespace and omits empty strings from the results .
| 108
| 33
|
159,810
|
public static boolean objectsNotEqual ( final Object one , final Object two ) { return ( one == null ) ? ( two != null ) : ( ! one . equals ( two ) ) ; }
|
Compares two objects for equality .
| 41
| 7
|
159,811
|
public static void addFieldToString ( final StringBuffer buffer , final String name , final Object value ) { buffer . append ( " <" ) ; buffer . append ( name ) ; buffer . append ( "=" ) ; buffer . append ( value ) ; buffer . append ( ">" ) ; }
|
Adds a string representation of the given field to the buffer .
| 62
| 12
|
159,812
|
public static void addPasswordFieldToString ( final StringBuffer buffer , final String name , final Object value ) { addFieldToString ( buffer , name , ( value == null ) ? null : "*****" ) ; }
|
Adds a string representation of the given password to the buffer . This will contain a row of asterisks if the password is non - null .
| 46
| 28
|
159,813
|
public final void service ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { _jspService ( request , response ) ; }
|
Entry point into service .
| 38
| 5
|
159,814
|
public Object put ( long key , Object value ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "put" , new Object [ ] { new Long ( key ) , value , this } ) ; if ( value == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "put" , "IllegalArgumentException" ) ; throw new IllegalArgumentException ( "Null is not a permitted value." ) ; } // Find an empty bucket for the new value or // a bucket the contains an entry with the // same key. int hash = getHashForNewEntry ( key ) ; // Store the value previously held in the bucket // mapping DELETED to null so that it // can be returned to the caller. Object previous = _values [ hash ] == DELETED ? null : _values [ hash ] ; // Add the new value and key to the map. _values [ hash ] = value ; _keys [ hash ] = key ; if ( previous == null ) { // This put resulted in a new entry being added to // the map rather than an existing entry being // updated. Increment the count of objects in the // map and rehash if necessary. _currentLoad ++ ; if ( _currentLoad == _resizeThreshold ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "put" , new Object [ ] { new Long ( key ) , value , this } ) ; // The current load of the map means that it // has reached the desired loadFactor. Increase // the size of the map and rehash all the entries. // Take a copy of the map's contents so that we // can add them back in once it's been resized. long [ ] oldKeys = new long [ _mapSize ] ; Object [ ] oldValues = new Object [ _mapSize ] ; System . arraycopy ( _keys , 0 , oldKeys , 0 , oldKeys . length ) ; System . arraycopy ( _values , 0 , oldValues , 0 , oldValues . length ) ; // We know that the inital size of the map // is a power of 2 so, by doubling it, we // can increase the map's capacity and // still be sure that it's size is a power // of two. _mapSize = ( _mapSize * 2 ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "mapSize = " + _mapSize ) ; _resizeThreshold = ( int ) ( ( ( float ) _mapSize ) * ( ( float ) _loadFactor ) / 100f ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "resizeThreshold = " + _resizeThreshold ) ; _values = new Object [ _mapSize ] ; _keys = new long [ _mapSize ] ; // Zero the count of objects in the map. This will // be incremented to the correct value as the // entries are added back into the resized map // below. _currentLoad = 0 ; // Loop through the old values adding live // entries back into the map. for ( int i = 0 ; i < oldValues . length ; i ++ ) { Object oldValue = oldValues [ i ] ; if ( oldValue != null && oldValue != DELETED ) { put ( oldKeys [ i ] , oldValue ) ; } } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "put" , previous ) ; return previous ; }
|
Store the given value in the map associating it with the given key . If the map already contains an entry associated with the given key that entry will be replaced .
| 753
| 33
|
159,815
|
public Object remove ( long key ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "remove" , new Object [ ] { new Long ( key ) , this } ) ; int hash = getHashForExistingEntry ( key ) ; Object result = null ; if ( hash >= 0 ) { result = _values [ hash ] ; } if ( result != null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Entry found in map - removing" ) ; _values [ hash ] = DELETED ; _currentLoad -- ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "remove" , result ) ; return result ; }
|
Remove the entry from the map that is associated with the given key .
| 153
| 14
|
159,816
|
public Object get ( long key ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "get" , new Object [ ] { new Long ( key ) , this } ) ; int hash = getHashForExistingEntry ( key ) ; Object value = null ; if ( hash >= 0 ) { value = _values [ hash ] ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "get" , value ) ; return value ; }
|
Return the entry from the map associated with the given key
| 104
| 11
|
159,817
|
private int getHashForKey ( long key ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getHashForKey" , new Object [ ] { new Long ( key ) , this } ) ; int hash = ( int ) ( key % _mapSize ) ; if ( hash < 0 ) hash = - hash ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getHashForKey" , new Integer ( hash ) ) ; return hash ; }
|
suitable int index into the map
| 108
| 7
|
159,818
|
private void processConfigProps ( Map < String , Object > props ) { if ( props == null || props . isEmpty ( ) ) return ; id = ( String ) props . get ( CFG_KEY_ID ) ; if ( id == null ) { Tr . error ( tc , "AUTHZ_ROLE_ID_IS_NULL" ) ; return ; } rolePids = ( String [ ] ) props . get ( CFG_KEY_ROLE ) ; // if (rolePids == null || rolePids.length < 1) // return; processRolePids ( ) ; }
|
Process the sytemRole properties from the server . xml .
| 130
| 12
|
159,819
|
private Configuration retrieveConfig ( NestedConfigHelper configHelper , ConfigurationAdmin configAdmin ) throws InitWithoutConfig { if ( configHelper == null ) throw new InitWithoutConfig ( "Configuration not found" ) ; // We need configAdmin to list the configurations of nested classloader elements with this application as their parent if ( configAdmin == null ) throw new InitWithoutConfig ( "ConfigurationAdmin service not found" ) ; String parentPid = ( String ) configHelper . get ( Constants . SERVICE_PID ) ; String sourcePid = ( String ) configHelper . get ( "ibm.extends.source.pid" ) ; if ( sourcePid != null ) { parentPid = sourcePid ; } try { StringBuilder filter = new StringBuilder ( ) ; filter . append ( "(&" ) ; filter . append ( FilterUtils . createPropertyFilter ( "service.factoryPid" , "com.ibm.ws.classloading.classloader" ) ) ; filter . append ( FilterUtils . createPropertyFilter ( "config.parentPID" , parentPid ) ) ; filter . append ( ")" ) ; Configuration [ ] configs = configAdmin . listConfigurations ( filter . toString ( ) ) ; if ( configs == null || configs . length != 1 ) { throw new InitWithoutConfig ( "No classloader element found" ) ; } Configuration config = configs [ 0 ] ; if ( config . getProperties ( ) == null ) { if ( tc . isErrorEnabled ( ) ) Tr . error ( tc , "cls.classloader.missing" , config . getPid ( ) ) ; config . delete ( ) ; throw new InitWithoutConfig ( "Classloader config not found" ) ; } return config ; } catch ( IOException e ) { throw new InitWithoutConfig ( "Configuration for classloader not found, exception " + e ) ; } catch ( InvalidSyntaxException e ) { throw new InitWithoutConfig ( "Configuration for classloader not found, exception " + e ) ; } }
|
get the configuration object or die trying
| 437
| 7
|
159,820
|
private List < String > getIds ( ConfigurationAdmin ca , String [ ] pids ) { final String methodName = "getIds(): " ; if ( pids == null ) { return Collections . emptyList ( ) ; } List < String > ids = new ArrayList < String > ( ) ; for ( String pid : pids ) { try { String filter = "(" + org . osgi . framework . Constants . SERVICE_PID + "=" + pid + ")" ; Configuration [ ] config = ca . listConfigurations ( filter ) ; if ( config == null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Configuration not found for pid " + pid ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Found config for " + pid ) ; String id = ( String ) config [ 0 ] . getProperties ( ) . get ( "id" ) ; ids . add ( id ) ; } } catch ( IOException e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Configuration not found for " + pid , e ) ; } catch ( InvalidSyntaxException e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "Configuration not found for " + pid , e ) ; } } return Collections . unmodifiableList ( ids ) ; }
|
Find the PID in the configAdmin and get the id corresponding to it .
| 315
| 15
|
159,821
|
private boolean folderContainsFiles ( File folder ) { if ( folder != null ) { File [ ] files = folder . listFiles ( ) ; for ( File file : files ) if ( file . isFile ( ) ) return true ; for ( File file : files ) if ( file . isDirectory ( ) ) if ( folderContainsFiles ( file ) ) return true ; } return false ; }
|
Breadth - first traversal of folder and any subdirectories looking for if any files exist
| 83
| 20
|
159,822
|
public static ASN1Sequence getInstance ( Object obj ) { if ( obj == null || obj instanceof ASN1Sequence ) { return ( ASN1Sequence ) obj ; } throw new IllegalArgumentException ( "unknown object in getInstance" ) ; }
|
return an ASN1Sequence from the given object .
| 58
| 12
|
159,823
|
private static boolean markError ( OverlayContainer overlay , String errorTag ) { if ( overlay . getFromNonPersistentCache ( errorTag , WebExtAdapter . class ) == null ) { overlay . addToNonPersistentCache ( errorTag , WebExtAdapter . class , errorTag ) ; return true ; } else { return false ; } }
|
Mark an error condition to an overlay container .
| 73
| 9
|
159,824
|
@ Override @ FFDCIgnore ( ParseException . class ) public com . ibm . ws . javaee . dd . webext . WebExt adapt ( Container root , OverlayContainer rootOverlay , ArtifactContainer artifactContainer , Container containerToAdapt ) throws UnableToAdaptException { // What web extension is stored depends on the web descriptor version: // either "ibm-web-ext.xmi" or "ibm-web-ext.xml". com . ibm . ws . javaee . dd . web . WebApp primary = containerToAdapt . adapt ( com . ibm . ws . javaee . dd . web . WebApp . class ) ; String primaryVersion = ( ( primary == null ) ? null : primary . getVersion ( ) ) ; boolean xmi = ( "2.2" . equals ( primaryVersion ) || "2.3" . equals ( primaryVersion ) || "2.4" . equals ( primaryVersion ) ) ; String ddEntryName ; if ( xmi ) { ddEntryName = com . ibm . ws . javaee . dd . webext . WebExt . XMI_EXT_NAME ; } else { ddEntryName = com . ibm . ws . javaee . dd . webext . WebExt . XML_EXT_NAME ; } Entry ddEntry = containerToAdapt . getEntry ( ddEntryName ) ; com . ibm . ws . javaee . ddmodel . webext . WebExtComponentImpl fromConfig = getConfigOverrides ( rootOverlay , artifactContainer ) ; // Neither the web-extension nor the configuration override is available: // Answer null. if ( ( ddEntry == null ) && ( fromConfig == null ) ) { return null ; } if ( ddEntry != null ) { com . ibm . ws . javaee . dd . webext . WebExt fromApp ; try { fromApp = new com . ibm . ws . javaee . ddmodel . webext . WebExtDDParser ( containerToAdapt , ddEntry , xmi ) . parse ( ) ; } catch ( ParseException e ) { throw new UnableToAdaptException ( e ) ; } if ( fromConfig == null ) { // Only the web extension is available. return fromApp ; } else { // Both are available: Answer the configuration override, with the // web extension set as a delegate. fromConfig . setDelegate ( fromApp ) ; return fromConfig ; } } else { // Only the configuration override is available. return fromConfig ; } }
|
Obtain the web extension for a module container .
| 550
| 10
|
159,825
|
private String stripExtension ( String moduleName ) { if ( moduleName . endsWith ( ".war" ) || moduleName . endsWith ( ".jar" ) ) { return moduleName . substring ( 0 , moduleName . length ( ) - 4 ) ; } return moduleName ; }
|
Strip the extension from a module name .
| 61
| 9
|
159,826
|
public final boolean isReconfigurable ( WSConnectionRequestInfoImpl cri , boolean reauth ) { // The CRI is only reconfigurable if all fields which cannot be changed already match. // Although sharding keys can sometimes be changed via connection.setShardingKey, // the spec does not guarantee that this method will allow all sharding keys // (even ones that are known to be valid) to be set on any connection. It leaves open // the possibility that the JDBC driver implementation can decide not to allow switching // between certain sharding keys. Given that we don't have any way of knowing in // advance that a switching will be accepted (without preemptively trying to change it), // we must consider sharding keys to be non-reconfigurable for the purposes of // selecting a connection from the pool. if ( reauth ) { return ivConfigID == cri . ivConfigID ; } else { return match ( ivUserName , cri . ivUserName ) && match ( ivPassword , cri . ivPassword ) && match ( ivShardingKey , cri . ivShardingKey ) && match ( ivSuperShardingKey , cri . ivSuperShardingKey ) && ivConfigID == cri . ivConfigID ; } }
|
Indicates whether a Connection with this CRI may be reconfigured to the specific CRI .
| 265
| 19
|
159,827
|
private boolean matchKerberosIdentities ( WSConnectionRequestInfoImpl cri ) { boolean flag = false ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "matchKerberosIdentities" , this , cri ) ; if ( kerberosIdentityisSet && cri . kerberosIdentityisSet ) { flag = AdapterUtil . matchGSSName ( cri . gssName , gssName ) ; } else if ( kerberosIdentityisSet || cri . kerberosIdentityisSet ) { // one of them is true, so no match flag = false ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "only one has kerberos identity attributes set so no match" ) ; } else { // else: both are are false thus, match if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "both have kerberos identity attributes not set so match" ) ; flag = true ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "matchKerberosIdentities" , flag ) ; return flag ; }
|
Per JAVA Docs method returns true if the two names contain at least one primitive element in common . If either of the names represents an anonymous entity the method will return false .
| 299
| 37
|
159,828
|
private static final boolean match ( Object obj1 , Object obj2 ) { return obj1 == obj2 || ( obj1 != null && obj1 . equals ( obj2 ) ) ; }
|
Determine if two objects either of which may be null are equal .
| 39
| 15
|
159,829
|
private final boolean matchCatalog ( WSConnectionRequestInfoImpl cri ) { // At least one of the CRIs should know the default value. String defaultValue = defaultCatalog == null ? cri . defaultCatalog : defaultCatalog ; return match ( ivCatalog , cri . ivCatalog ) || ivCatalog == null && match ( defaultValue , cri . ivCatalog ) || cri . ivCatalog == null && match ( ivCatalog , defaultValue ) ; }
|
Determine if the catalog property matches . It is considered to match if - Both catalog values are unspecified . - Both catalog values are the same value . - One of the catalog values is unspecified and the other CRI requested the default value .
| 95
| 49
|
159,830
|
private final boolean matchSchema ( WSConnectionRequestInfoImpl cri ) { // At least one of the CRIs should know the default value. String defaultValue = defaultSchema == null ? cri . defaultSchema : defaultSchema ; return match ( ivSchema , cri . ivSchema ) || ivSchema == null && match ( defaultValue , cri . ivSchema ) || cri . ivSchema == null && match ( ivSchema , defaultValue ) ; }
|
Determine if the schema property matches . It is considered to match if - Both schema values are unspecified . - Both schema values are the same value . - One of the schema values is unspecified and the other CRI requested the default value .
| 105
| 49
|
159,831
|
private final boolean matchNetworkTimeout ( WSConnectionRequestInfoImpl cri ) { // At least one of the CRIs should know the default value. int defaultValue = defaultNetworkTimeout == 0 ? cri . defaultNetworkTimeout : defaultNetworkTimeout ; return ivNetworkTimeout == cri . ivNetworkTimeout || ivNetworkTimeout == 0 && ( defaultValue == cri . ivNetworkTimeout ) || cri . ivNetworkTimeout == 0 && ivNetworkTimeout == defaultValue ; }
|
Determine if the networkTimeout property matches . It is considered to match if - Both networkTimeout values are unspecified . - Both networkTimeout values are the same value . - One of the networkTimeout values is unspecified and the other CRI requested the default value .
| 98
| 53
|
159,832
|
private final boolean matchHoldability ( WSConnectionRequestInfoImpl cri ) { // At least one of the CRIs should know the default value. int defaultValue = defaultHoldability == 0 ? cri . defaultHoldability : defaultHoldability ; return ivHoldability == cri . ivHoldability || ivHoldability == 0 && match ( defaultValue , cri . ivHoldability ) || cri . ivHoldability == 0 && match ( ivHoldability , defaultValue ) ; }
|
Determine if the result set holdability property matches . It is considered to match if - Both holdability values are unspecified . - Both holdability values are the same value . - One of the holdability values is unspecified and the other CRI requested the default value .
| 102
| 55
|
159,833
|
private final boolean matchReadOnly ( WSConnectionRequestInfoImpl cri ) { // At least one of the CRIs should know the default value. Boolean defaultValue = defaultReadOnly == null ? cri . defaultReadOnly : defaultReadOnly ; return match ( ivReadOnly , cri . ivReadOnly ) || ivReadOnly == null && match ( defaultValue , cri . ivReadOnly ) || cri . ivReadOnly == null && match ( ivReadOnly , defaultValue ) ; }
|
Determine if the read - only property matches . It is considered to match if - Both read - only values are unspecified . - Both read - only values are the same value . - One of the read - only values is unspecified and the other CRI requested the default value .
| 105
| 57
|
159,834
|
private final boolean matchTypeMap ( WSConnectionRequestInfoImpl cri ) { // At least one of the CRIs should know the default value. Map < String , Class < ? > > defaultValue = defaultTypeMap == null ? cri . defaultTypeMap : defaultTypeMap ; return matchTypeMap ( ivTypeMap , cri . ivTypeMap ) || ivTypeMap == null && matchTypeMap ( defaultValue , cri . ivTypeMap ) || cri . ivTypeMap == null && matchTypeMap ( ivTypeMap , defaultValue ) ; }
|
Determine if the type map property matches . It is considered to match if - Both type map values are unspecified . - Both type map values are the same value . - One of the type map values is unspecified and the other CRI requested the default value .
| 119
| 53
|
159,835
|
public static final boolean matchTypeMap ( Map < String , Class < ? > > m1 , Map < String , Class < ? > > m2 ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "matchTypeMap" , new Object [ ] { m1 , m2 } ) ; boolean match = false ; if ( m1 == m2 ) match = true ; else if ( m1 != null && m1 . equals ( m2 ) ) match = true ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "matchTypeMap" , match ) ; return match ; }
|
determines if two typeMaps match . Note that this method takes under account an Oracle 11g change with TypeMap
| 163
| 24
|
159,836
|
public void setDefaultValues ( String catalog , int holdability , Boolean readOnly , Map < String , Class < ? > > typeMap , String schema , int networkTimeout ) { defaultCatalog = catalog ; defaultHoldability = holdability ; defaultReadOnly = readOnly ; defaultTypeMap = typeMap ; defaultSchema = schema ; defaultNetworkTimeout = networkTimeout ; }
|
Initialize default values that are used for unspecified properties . This allows us to match unspecified values with specified values in another CRI .
| 77
| 26
|
159,837
|
public boolean isCRIChangable ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "isCRIChangable :" , changable ) ; return changable ; }
|
returns boolean indicating if cri is changable or not .
| 59
| 13
|
159,838
|
public void setCatalog ( String catalog ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: catalog, cri" , catalog , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting catalog on the CRI to: " + catalog ) ; ivCatalog = catalog ; }
|
Change the value of the catalog property in the connection request information .
| 130
| 13
|
159,839
|
public void setHoldability ( int holdability ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: holdability, cri" , holdability , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting holdability on the CRI to: " + holdability ) ; ivHoldability = holdability ; }
|
Change the value of the result set holdability property in the connection request information .
| 138
| 16
|
159,840
|
public void setTransactionIsolationLevel ( int iso ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , "ConnectionRequestInfo cannot be modified, doing so may result in corruption: iso , cri" , iso , this ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting isolation level on the CRI to:" , iso ) ; ivIsoLevel = iso ; }
|
sets the isolation level for this CRI . The J2C team are aware of the change and they are ok with setting the isolation level as the values are not part of the hashCode and hence any changes there will not affect the bucket in which the mc will reside in the connection pool We are in need for setting the cri in case the application sets the value on the connection .
| 129
| 78
|
159,841
|
public void setReadOnly ( boolean readOnly ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: readOnly , cri" , readOnly , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting read only on the CRI to:" , readOnly ) ; ivReadOnly = readOnly ; }
|
sets the readonly for this CRI . The J2C team are aware of the change and they are ok with setting the readonly as the values are not part of the hashCode and hence any changes there will not affect the bucket in which the mc will reside in the connection pool . We are in need for setting the cri in case the application sets the value on the connection .
| 137
| 79
|
159,842
|
public void setShardingKey ( Object shardingKey ) throws SQLException { if ( ! changable ) throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , "ConnectionRequestInfo cannot be modified, doing so may result in corruption: shardingKey, cri" , shardingKey , this ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting sharding key on the CRI to: " + shardingKey ) ; ivShardingKey = shardingKey ; }
|
Change the value of the sharding key property in the connection request information .
| 138
| 15
|
159,843
|
public void setSuperShardingKey ( Object superShardingKey ) throws SQLException { if ( ! changable ) throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , "ConnectionRequestInfo cannot be modified, doing so may result in corruption: superShardingKey, cri" , superShardingKey , this ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting super sharding key on the CRI to: " + superShardingKey ) ; ivSuperShardingKey = superShardingKey ; }
|
Change the value of the super sharding key property in the connection request information .
| 146
| 16
|
159,844
|
public void setTypeMap ( Map < String , Class < ? > > map ) throws SQLException { if ( ! changable ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "WS_INTERNAL_ERROR" , new Object [ ] { "ConnectionRequestInfo cannot be modified, doing so may result in corruption: type map, cri" , map , this } ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Setting the type map on the CRI to: " + map ) ; ivTypeMap = map ; }
|
Change the value of the type map property in the connection request information .
| 143
| 14
|
159,845
|
public static WSConnectionRequestInfoImpl createChangableCRIFromNon ( WSConnectionRequestInfoImpl oldCRI ) { WSConnectionRequestInfoImpl connInfo = new WSConnectionRequestInfoImpl ( oldCRI . getUserName ( ) , oldCRI . getPassword ( ) , oldCRI . getIsolationLevel ( ) , oldCRI . getCatalog ( ) , oldCRI . isReadOnly ( ) , oldCRI . getShardingKey ( ) , oldCRI . getSuperShardingKey ( ) , oldCRI . getTypeMap ( ) , oldCRI . getHoldability ( ) , oldCRI . getSchema ( ) , oldCRI . getNetworkTimeout ( ) , oldCRI . getConfigID ( ) , oldCRI . getSupportIsolvlSwitchingValue ( ) ) ; connInfo . setDefaultValues ( oldCRI . defaultCatalog , oldCRI . defaultHoldability , oldCRI . defaultReadOnly , oldCRI . defaultTypeMap , oldCRI . defaultSchema , oldCRI . defaultNetworkTimeout ) ; connInfo . markAsChangable ( ) ; return connInfo ; }
|
utility to create changable CRI from non changable one .
| 250
| 14
|
159,846
|
@ Override protected void processAnnotations ( Object instance ) throws IllegalAccessException , InvocationTargetException , NamingException { if ( context == null ) { // No resource injection return ; } checkAnnotation ( instance . getClass ( ) , instance ) ; /* * May be only check non private fields and methods * for @Resource (JSR 250), if used all superclasses MUST be examined * to discover all uses of this annotation. */ Class superclass = instance . getClass ( ) . getSuperclass ( ) ; while ( superclass != null && ( ! superclass . equals ( Object . class ) ) ) { checkAnnotation ( superclass , instance ) ; superclass = superclass . getSuperclass ( ) ; } }
|
Inject resources in specified instance .
| 154
| 7
|
159,847
|
protected static void lookupMethodResource ( javax . naming . Context context , Object instance , Method method , String name ) throws NamingException , IllegalAccessException , InvocationTargetException { if ( ! method . getName ( ) . startsWith ( "set" ) || method . getParameterTypes ( ) . length != 1 || ! method . getReturnType ( ) . getName ( ) . equals ( "void" ) ) { throw new IllegalArgumentException ( "Invalid method resource injection annotation" ) ; } Object lookedupResource ; if ( ( name != null ) && ( name . length ( ) > 0 ) ) { // TODO local or global JNDI lookedupResource = context . lookup ( JAVA_COMP_ENV + name ) ; } else { // TODO local or global JNDI lookedupResource = context . lookup ( JAVA_COMP_ENV + instance . getClass ( ) . getName ( ) + "/" + getFieldName ( method ) ) ; } boolean accessibility = method . isAccessible ( ) ; method . setAccessible ( true ) ; method . invoke ( instance , lookedupResource ) ; method . setAccessible ( accessibility ) ; }
|
Inject resources in specified method .
| 257
| 7
|
159,848
|
private void _send ( SIBusMessage msg , SITransaction tran ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIErrorException , SINotAuthorizedException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_send" ) ; boolean sendSuccessful = false ; // Get the message priority short jfapPriority = JFapChannelConstants . getJFAPPriority ( msg . getPriority ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending with JFAP priority of " + jfapPriority ) ; updateLowestPriority ( jfapPriority ) ; // *** Complex logic to determine if we can get away we need a reply to *** // *** this send operation. *** final boolean requireReply ; if ( tran != null && ! exchangeTransactedSends ) { // If there is a transaction, and we haven't been explicitly told to exchange // transacted sends - then a reply is NOT required. requireReply = false ; } else if ( exchangeExpressSends ) { // We have been prohibited from sending (rather than exchanging) low // qualities of service - thus there is no way that we can avoid requiring // a reply. requireReply = true ; } else { // We CAN perform the optimization where low qualities of service can be sent // without requiring a reply. Check the message quality of service. requireReply = ( msg . getReliability ( ) != Reliability . BEST_EFFORT_NONPERSISTENT ) && ( msg . getReliability ( ) != Reliability . EXPRESS_NONPERSISTENT ) ; } // *** end of "is a reply required" logic *** // If we are at FAP9 or above we can do a 'chunked' send of the message in seperate // slices to make life easier on the Java memory manager final HandshakeProperties props = getConversation ( ) . getHandshakeProperties ( ) ; if ( props . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_9 ) { sendChunkedMessage ( tran , msg , requireReply , jfapPriority ) ; } else { sendEntireMessage ( tran , msg , null , requireReply , jfapPriority ) ; } sendSuccessful = true ; if ( TraceComponent . isAnyTracingEnabled ( ) ) CommsLightTrace . traceMessageId ( tc , "SendMsgTrace" , msg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_send" ) ; }
|
This method performs the actual send but does no parameter checking and gets no locks needed to perform the send . This should be done by a suitable super - method .
| 668
| 32
|
159,849
|
private void sendEntireMessage ( SITransaction tran , SIBusMessage msg , List < DataSlice > messageSlices , boolean requireReply , short jfapPriority ) throws SIResourceException , SISessionUnavailableException , SINotPossibleInCurrentConfigurationException , SIIncorrectCallException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendEntireMessage" , new Object [ ] { tran , msg , messageSlices , requireReply , jfapPriority } ) ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; request . putSITransaction ( tran ) ; if ( messageSlices == null ) { request . putClientMessage ( msg , getCommsConnection ( ) , getConversation ( ) ) ; } else { request . putMessgeWithoutEncode ( messageSlices ) ; } sendData ( request , jfapPriority , requireReply , tran , JFapChannelConstants . SEG_SEND_SESS_MSG , JFapChannelConstants . SEG_SEND_SESS_MSG_NOREPLY , JFapChannelConstants . SEG_SEND_SESS_MSG_R ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendEntireMessage" ) ; }
|
Sends the entire message in one big JFap message . This requires the allocation of one big area of storage for the whole message . If the messageSlices parameter is not null then the message has already been encoded and can just be added into the buffer without encoding again .
| 370
| 57
|
159,850
|
private void sendData ( CommsByteBuffer request , short jfapPriority , boolean requireReply , SITransaction tran , int outboundSegmentType , int outboundNoReplySegmentType , int replySegmentType ) throws SIResourceException , SISessionUnavailableException , SINotPossibleInCurrentConfigurationException , SIIncorrectCallException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendData" , new Object [ ] { request , jfapPriority , requireReply , tran , outboundSegmentType , outboundNoReplySegmentType , replySegmentType } ) ; if ( requireReply ) { // Pass on call to server CommsByteBuffer reply = jfapExchange ( request , outboundSegmentType , jfapPriority , false ) ; try { short err = reply . getCommandCompletionCode ( replySegmentType ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SILimitExceededException ( reply , err ) ; checkFor_SINotAuthorizedException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SINotPossibleInCurrentConfigurationException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } } else { jfapSend ( request , outboundNoReplySegmentType , jfapPriority , false , ThrottlingPolicy . BLOCK_THREAD ) ; // Update the lowest priority if ( tran != null ) { ( ( Transaction ) tran ) . updateLowestMessagePriority ( jfapPriority ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendData" ) ; }
|
This helper method is used to send the final or only part of a message to our peer . It takes care of whether we should be exchanging the message and deals with the exceptions returned .
| 553
| 37
|
159,851
|
public void close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; // Have we already been closed? if ( ! isClosed ( ) ) { try { closeLock . writeLock ( ) . lockInterruptibly ( ) ; try { CommsByteBuffer request = getCommsByteBuffer ( ) ; // Build Message Header request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; // Pass on call to server CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_CLOSE_PRODUCER_SESS , lowestPriority , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_CLOSE_PRODUCER_SESS_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } setClosed ( ) ; if ( oc != null ) oc . decrementUseCount ( ) ; } finally { closeLock . writeLock ( ) . unlock ( ) ; } } catch ( InterruptedException e ) { // No FFDC code needed } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
|
Closes the ProducerSession .
| 427
| 6
|
159,852
|
private static Object getFieldValue ( FieldClassValue fieldClassValue , Object obj ) { try { return fieldClassValue . get ( obj . getClass ( ) ) . get ( obj ) ; } catch ( IllegalAccessException e ) { // FieldClassValueFactory returns ClassValue that make the Field // accessible, so this should not happen. throw new IllegalStateException ( e ) ; } }
|
Get the value of a field from an object .
| 81
| 10
|
159,853
|
public static WrapperProxyState getLocalBeanWrapperProxyState ( LocalBeanWrapperProxy obj ) { // F58064 BusinessLocalWrapperProxy proxyStateHolder = ( BusinessLocalWrapperProxy ) getFieldValue ( svLocalBeanWrapperProxyStateFieldClassValue , obj ) ; return proxyStateHolder . ivState ; }
|
Returns the wrapper proxy object for an object that implements LocalBeanWrapperProxy . This operation should never fail but if it does exceptions will be thrown as EJBException .
| 74
| 35
|
159,854
|
protected void registerServant ( ) { if ( ivRemoteObjectWrapper != null ) { // synchronized on the remote Wrapper to set the isRemoteRegistered flag synchronized ( ivRemoteObjectWrapper ) { if ( ! isRemoteRegistered ) { try { if ( ! isZOS ) // LIDB2775-23.9 { // Servant registration must be performed with the application classloader // in force. This is especially needed for JITDeploy since // the JIT pluggin will be on the application classloader. // Without the JIT pluggin the classloader will not trigger // JITDeploy to create the stub. //d521388 Object originalLoader = ThreadContextAccessor . UNCHANGED ; try { if ( ivBMD != null ) // EJBFactories have no BMD d529446 { originalLoader = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( ivBMD . classLoader ) ; //PK83186 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( originalLoader != ThreadContextAccessor . UNCHANGED ) { Tr . debug ( tc , "registerServant : old ClassLoader = " + originalLoader ) ; Tr . debug ( tc , "registerServant : new ClassLoader = " + ivBMD . classLoader ) ; } else { Tr . debug ( tc , "registerServant : current ClassLoader = " + ivBMD . classLoader ) ; } } } ivRemoteObjectWrapper . container . getEJBRuntime ( ) . registerServant ( ivRemoteObjectWrapper . beanId . getByteArray ( ) , ivRemoteObjectWrapper ) ; } finally { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( originalLoader ) ; } // finally } // if( !isZOS ) isRemoteRegistered = true ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".registerServant" , "184" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to register wrapper instance" , new Object [ ] { ivRemoteObjectWrapper , ex } ) ; } } } // if ( !isRemoteRegistered ) } // synchronized( ivRemoteObject ) } // if ( ivRemoteObject != null ) }
|
Register the remote wrapper servant to ORB .
| 524
| 9
|
159,855
|
private void registerServant ( BusinessRemoteWrapper wrapper , int i ) { // synchronized on the remote Wrapper to set the isRemoteRegistered flag synchronized ( wrapper ) { if ( ! ivBusinessRemoteRegistered [ i ] ) { try { if ( ! isZOS ) { // Since there may be multiple remote interfaces per bean // type, a unique WrapperId must be formed by combining the // BeanId with specific remote interface information. d419704 WrapperId wrapperId = new WrapperId ( wrapper . beanId . getByteArrayBytes ( ) , wrapper . bmd . ivBusinessRemoteInterfaceClasses [ i ] . getName ( ) , i ) ; // Servant registration must be performed with the application classloader // in force. This is especially needed for JITDeploy since // the JIT pluggin will be on the application classloader. // Without the JIT pluggin the classloader will not trigger // JITDeploy to create the stub. //d521388 Object originalLoader = ThreadContextAccessor . UNCHANGED ; try { if ( ivBMD != null ) // EJBFactories have no BMD. d529446 { originalLoader = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( ivBMD . classLoader ) ; //PK83186 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( originalLoader != ThreadContextAccessor . UNCHANGED ) { Tr . debug ( tc , "registerServant : old ClassLoader = " + originalLoader ) ; Tr . debug ( tc , "registerServant : new ClassLoader = " + ivBMD . classLoader ) ; } else { Tr . debug ( tc , "registerServant : current ClassLoader = " + ivBMD . classLoader ) ; } } } wrapper . container . getEJBRuntime ( ) . registerServant ( wrapperId , wrapper ) ; } finally { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( originalLoader ) ; } // finally } // if( !isZOS ) ivBusinessRemoteRegistered [ i ] = true ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".registerServant" , "439" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to register wrapper instance" , new Object [ ] { wrapper , ex } ) ; } } } // if ( ! ivBusinessRemoteRegistered[i] ) } //synchronized( wrapper ) }
|
d416391 added entire method .
| 570
| 7
|
159,856
|
protected void disconnect ( ) { if ( localWrapperProxyState != null ) // F58064 { localWrapperProxyState . disconnect ( ) ; } if ( ivBusinessLocalWrapperProxyStates != null ) // F58064 { for ( WrapperProxyState state : ivBusinessLocalWrapperProxyStates ) { state . disconnect ( ) ; } } if ( ivRemoteObjectWrapper != null ) { // synchronized on the remote Wrapper to set the isRemoteRegistered flag synchronized ( ivRemoteObjectWrapper ) { if ( isRemoteRegistered ) { try { // @PQ98903A // On zOS even though we don't call the object // adapter to register the servant, we need // to call it to unregister it if the wrapper // is connected to the ORB (i.e. it has a Tie). if ( ( ! isZOS ) || ( ivRemoteObjectWrapper . intie != null ) ) // @PQ98903C { ivRemoteObjectWrapper . container . getEJBRuntime ( ) . unregisterServant ( ivRemoteObjectWrapper ) ; } isRemoteRegistered = false ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".unregisterServant" , "207" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to unregister wrapper instance" , new Object [ ] { ivRemoteObjectWrapper , ex } ) ; } } } } } // d416391 start // Unregister any BusinessRemoteWrapper objects that are registered with ORB. if ( ivBusinessRemote != null ) // d416391 d424839 { int numWrappers = ivBusinessRemote . length ; for ( int i = 0 ; i < numWrappers ; ++ i ) { BusinessRemoteWrapper wrapper = ivBusinessRemote [ i ] ; synchronized ( wrapper ) { if ( ivBusinessRemoteRegistered [ i ] ) { try { // On zOS even though we don't call the object adapter to register // the servant, we need to call it to unregister it if the wrapper // is connected to the ORB (i.e. it has a Tie). if ( ( ! isZOS ) || ( wrapper . intie != null ) ) { wrapper . container . getEJBRuntime ( ) . unregisterServant ( wrapper ) ; } ivBusinessRemoteRegistered [ i ] = false ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".unregisterServant" , "516" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to unregister wrapper instance" , new Object [ ] { wrapper , ex } ) ; } } } } // end synchronized } // end for } // d416391 end }
|
Disconnect all wrappers . Unregisters the remote wrapper servant from ORB and disconnects local wrapper proxy states .
| 625
| 24
|
159,857
|
public EJBLocalObject getLocalObject ( ) { if ( localObject != null ) { if ( localWrapperProxyState != null && localWrapperProxyState . ivWrapper == null ) { localWrapperProxyState . connect ( ivBeanId , localWrapper ) ; } return localObject ; } throw new IllegalStateException ( "Local interface not defined" ) ; }
|
Returns a client proxy object for the local component view .
| 82
| 11
|
159,858
|
public Object getBusinessObject ( String interfaceName ) throws RemoteException { int interfaceIndex = ivBMD . getLocalBusinessInterfaceIndex ( interfaceName ) ; if ( interfaceIndex != - 1 ) { return getLocalBusinessObject ( interfaceIndex ) ; } interfaceIndex = ivBMD . getRemoteBusinessInterfaceIndex ( interfaceName ) ; if ( interfaceIndex != - 1 ) { return getRemoteBusinessObject ( interfaceIndex ) ; } throw new IllegalStateException ( "Requested business interface not found : " + interfaceName ) ; }
|
Method to get a business object given the name of the interface .
| 110
| 13
|
159,859
|
public Object getLocalBusinessObject ( int interfaceIndex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getLocalBusinessObject : " + ivBusinessLocalProxies [ interfaceIndex ] . getClass ( ) . getName ( ) ) ; if ( ivBusinessLocalWrapperProxyStates != null && ivBusinessLocalWrapperProxyStates [ interfaceIndex ] . ivWrapper == null ) { ivBusinessLocalWrapperProxyStates [ interfaceIndex ] . connect ( ivBeanId , ivBusinessLocal [ interfaceIndex ] ) ; } return ivBusinessLocalProxies [ interfaceIndex ] ; }
|
Method to get the local business object given the index of the interface . The returned object will be a wrapper a no - interface wrapper or a local wrapper proxy .
| 142
| 32
|
159,860
|
public EJSWrapperBase getLocalBusinessWrapperBase ( int interfaceIndex ) { if ( interfaceIndex == 0 && ivBMD . ivLocalBean ) { return getLocalBeanWrapperBase ( ( LocalBeanWrapper ) ivBusinessLocal [ 0 ] ) ; } return ( EJSWrapperBase ) ivBusinessLocal [ 0 ] ; }
|
Method to get the local business wrapper base .
| 78
| 9
|
159,861
|
public Object getRemoteBusinessObject ( int interfaceIndex ) throws RemoteException { Class < ? > [ ] bInterfaceClasses = ivBMD . ivBusinessRemoteInterfaceClasses ; BusinessRemoteWrapper wrapper = ivBusinessRemote [ interfaceIndex ] ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getRemoteBusinessObject : " + wrapper . getClass ( ) . getName ( ) ) ; registerServant ( wrapper , interfaceIndex ) ; ClassLoader moduleContextClassLoader = ivBMD . ivContextClassLoader ; Object result = getRemoteBusinessReference ( wrapper , moduleContextClassLoader , bInterfaceClasses [ interfaceIndex ] ) ; return result ; }
|
Method to get the remote business object given the index of the interface .
| 154
| 14
|
159,862
|
public BusinessRemoteWrapper getRemoteBusinessWrapper ( WrapperId wrapperId ) { int remoteIndex = wrapperId . ivInterfaceIndex ; BusinessRemoteWrapper wrapper = null ; String wrapperInterfaceName = "" ; if ( remoteIndex < ivBusinessRemote . length ) { wrapper = ivBusinessRemote [ remoteIndex ] ; wrapperInterfaceName = ivBMD . ivBusinessRemoteInterfaceClasses [ remoteIndex ] . getName ( ) ; } // Is the BusinessRemoteWrapper for the correct interface name? String interfaceName = wrapperId . ivInterfaceClassName ; if ( ( wrapper == null ) || ( ! wrapperInterfaceName . equals ( interfaceName ) ) ) { // Nope, index must be invalid, so we need to search the entire // array to find the one that matches the desired interface name. // Fix up the WrapperId with index that matches this server. wrapper = null ; for ( int i = 0 ; i < ivBusinessRemote . length ; ++ i ) { wrapperInterfaceName = ivBMD . ivBusinessRemoteInterfaceClasses [ i ] . getName ( ) ; if ( wrapperInterfaceName . equals ( interfaceName ) ) { // This is the correct wrapper. remoteIndex = i ; wrapper = ivBusinessRemote [ remoteIndex ] ; wrapperId . ivInterfaceIndex = remoteIndex ; break ; } } // d739542 Begin if ( wrapper == null ) { throw new IllegalStateException ( "Remote " + interfaceName + " interface not defined" ) ; } // d739542 End } registerServant ( wrapper , remoteIndex ) ; return wrapper ; }
|
d419704 - rewrote for new WrapperId fields and remove the todo .
| 330
| 19
|
159,863
|
private String getAliasToFinalize ( CMConfigData cmConfigData ) { String alias = null ; if ( cmConfigData == null ) return alias ; // Not expected, but being safe // Check for DefaultPrincipalMapping alias from res-ref: final String DEFAULT_PRINCIPAL_MAPPING = "DefaultPrincipalMapping" ; final String MAPPING_ALIAS = "com.ibm.mapping.authDataAlias" ; String loginConfigurationName = cmConfigData . getLoginConfigurationName ( ) ; if ( ( loginConfigurationName != null ) && ( ! loginConfigurationName . equals ( "" ) ) ) { if ( loginConfigurationName . equals ( DEFAULT_PRINCIPAL_MAPPING ) ) { HashMap loginConfigProps = cmConfigData . getLoginConfigProperties ( ) ; if ( ( loginConfigProps != null ) && ( ! loginConfigProps . isEmpty ( ) ) ) { alias = ( String ) loginConfigProps . get ( MAPPING_ALIAS ) ; } } } if ( alias == null ) { // Check for container-managed auth alias from CF/DS: alias = cmConfigData . getContainerAlias ( ) ; } return alias ; }
|
Get the jaas alias from the config .
| 263
| 9
|
159,864
|
private Set getPrivateGenericCredentials ( final Subject subj ) throws ResourceException { Set privateGenericCredentials = null ; if ( System . getSecurityManager ( ) != null ) { try { privateGenericCredentials = ( Set ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { @ Override public Object run ( ) throws Exception { return subj . getPrivateCredentials ( GenericCredential . class ) ; } } ) ; } catch ( PrivilegedActionException pae ) { FFDCFilter . processException ( pae , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "18" , this ) ; Tr . error ( tc , "FAILED_DOPRIVILEGED_J2CA0060" , pae ) ; Exception e = pae . getException ( ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper failed attempting to access Subject's credentials" ) ; re . initCause ( e ) ; throw re ; } } else { privateGenericCredentials = subj . getPrivateCredentials ( GenericCredential . class ) ; } return privateGenericCredentials ; }
|
Return the set of private credentials of type GenericCredential from the given subject .
| 263
| 17
|
159,865
|
private Object setJ2CThreadIdentity ( final Subject subj ) throws ResourceException { Object retObject = null ; try { if ( System . getSecurityManager ( ) != null ) { retObject = AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { @ Override public Object run ( ) throws Exception { return ThreadIdentityManager . setJ2CThreadIdentity ( subj ) ; } } ) ; } else { retObject = ThreadIdentityManager . setJ2CThreadIdentity ( subj ) ; } } catch ( PrivilegedActionException pae ) { FFDCFilter . processException ( pae , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "11" , this ) ; Tr . error ( tc , "FAILED_DOPRIVILEGED_J2CA0060" , pae ) ; Exception e = pae . getException ( ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to push the current user identity to the OS Thread" ) ; re . initCause ( e ) ; throw re ; } catch ( IllegalStateException ise ) { FFDCFilter . processException ( ise , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "20" , this ) ; Object [ ] parms = new Object [ ] { "ThreadIdentitySecurityHelper.beforeGettingConnection()" , ise } ; Tr . error ( tc , "ILLEGAL_STATE_EXCEPTION_J2CA0079" , parms ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to push the current user identity to the OS Thread" ) ; re . initCause ( ise ) ; throw re ; } catch ( ThreadIdentityException tie ) { FFDCFilter . processException ( tie , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "21" , this ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to push the current user identity to the OS Thread" ) ; re . initCause ( tie ) ; throw re ; } return retObject ; }
|
Apply the given subject s identity to the thread .
| 507
| 10
|
159,866
|
private void checkForUTOKENNotFoundError ( Subject subj ) throws ResourceException { // A Subject without a UTOKEN genericCredential can // legitimately occur in the case where the resource // adapter has indicated Thread Identity Support // is "ALLOWED, but a valid Container-managed alias // was specified. On the other hand, at this ponit, if // either of the following two cases exist when there is // no UTOKEN genericCredential, then we have an // unexpected error and need to throw an exception: // // 1. The resource adapter REQUIRES that Thread Identity // be used. // // 2. The Subject has no private credentials at all // // Check if ThreadIdentitySupport is "REQUIRED" if ( m_ThreadIdentitySupport == AbstractConnectionFactoryService . THREAD_IDENTITY_REQUIRED ) { // ThreadIdentitySupport indicates that the use of thread // identity is "REQUIRED" by the connector, but the // Subject doesn't contain a UTOKEN GenericCredential. // This should not ever occur because finalizeSubject() // should have created a Subject with a UTOKEN // GenericCredential when ThreadidentitySupport is // "REQUIRED". Thus, throw an exception to terminate // processing right here. // try { IllegalStateException e = new IllegalStateException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject not setup for using thread identity, but the connector requires thread identity be used." ) ; Object [ ] parms = new Object [ ] { "ThreadIdentitySecurityHelper.beforeGettingConnection()" , e } ; Tr . error ( tc , "ILLEGAL_STATE_EXCEPTION_J2CA0079" , parms ) ; throw e ; } catch ( IllegalStateException ise ) { ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state" ) ; re . initCause ( ise ) ; throw re ; } } // end if m_ThreadIdentitySupport.equals REQUIRED // Check if Subject has at least one a private credential Set privateCredentials = subj . getPrivateCredentials ( ) ; Iterator privateIterator = privateCredentials . iterator ( ) ; if ( ! privateIterator . hasNext ( ) ) { // if no private credentials // There is not only no UTOKEN generic credential, but // also, there are no private credentials at all. This // should not happen. If there are no private credentials, // the finalizeSubject() processing should have built // a UTOKEN generic credential. // try { IllegalStateException e = new IllegalStateException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with no credentials." ) ; Object [ ] parms = new Object [ ] { "ThreadIdentitySecurityHelper.beforeGettingConnection()" , e } ; Tr . error ( tc , "ILLEGAL_STATE_EXCEPTION_J2CA0079" , parms ) ; throw e ; } catch ( IllegalStateException ise ) { ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state" ) ; re . initCause ( ise ) ; throw re ; } } // end if no private credentials }
|
Check for an unexpected condition when a UTOKEN is not found in the Subject .
| 702
| 17
|
159,867
|
protected void copyStreams ( InputStream is , OutputStream os ) throws IOException { byte [ ] buffer = new byte [ 1024 ] ; try { int read ; while ( ( read = is . read ( buffer ) ) != - 1 ) { os . write ( buffer , 0 , read ) ; buffer = new byte [ 1024 ] ; } } finally { if ( null != os ) os . close ( ) ; if ( null != is ) is . close ( ) ; } }
|
Reads from the input stream and copies to the output stream
| 100
| 12
|
159,868
|
protected ExtractedFileInformation extractFileFromArchive ( String fileName , String regex ) throws RepositoryArchiveException , RepositoryArchiveEntryNotFoundException , RepositoryArchiveIOException { JarFile jarFile = null ; ExtractedFileInformation result = null ; File outputFile = null ; File sourceArchive = new File ( fileName ) ; try { try { jarFile = new JarFile ( sourceArchive ) ; } catch ( FileNotFoundException | NoSuchFileException fne ) { throw new RepositoryArchiveException ( "Unable to locate archive " + fileName , sourceArchive , fne ) ; } catch ( IOException ioe ) { throw new RepositoryArchiveIOException ( "Error opening archive " , sourceArchive , ioe ) ; } Enumeration < JarEntry > enumEntries = jarFile . entries ( ) ; // Iterate through the files in the jar file searching for one we // are interested in while ( enumEntries . hasMoreElements ( ) ) { JarEntry entry = enumEntries . nextElement ( ) ; String name = entry . getName ( ) ; if ( Pattern . matches ( regex , name ) ) { // Don't want to use the entire path to the file so create a // file // and then recreate it using just the "name" part of the // filename outputFile = new File ( name ) ; outputFile = new File ( outputFile . getName ( ) ) ; outputFile . deleteOnExit ( ) ; try { copyStreams ( jarFile . getInputStream ( entry ) , new FileOutputStream ( outputFile ) ) ; } catch ( IOException ioe ) { throw new RepositoryArchiveIOException ( "Failed to extract file " + name + " inside " + fileName + " to " + outputFile . getAbsolutePath ( ) , sourceArchive , ioe ) ; } result = new ExtractedFileInformation ( outputFile , sourceArchive , name ) ; break ; } } } finally { try { if ( null != jarFile ) { jarFile . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RepositoryArchiveIOException ( "Error closing archive " , sourceArchive , e ) ; } } // Make sure we have found a file if ( null == outputFile ) { throw new RepositoryArchiveEntryNotFoundException ( "Failed to find file matching regular expression <" + regex + "> inside archive " + fileName , sourceArchive , regex ) ; } return result ; }
|
Extract a file from a jar file to a temporary location on disk that is deleted when the jvm exits .
| 547
| 23
|
159,869
|
protected void processLAandLI ( File archive , RepositoryResourceWritable resource , ProvisioningFeatureDefinition feature ) throws IOException , RepositoryException { String LAHeader = feature . getHeader ( LA_HEADER_FEATURE ) ; String LIHeader = feature . getHeader ( LI_HEADER_FEATURE ) ; processLAandLI ( archive , resource , LAHeader , LIHeader ) ; }
|
Locate and process license agreement and information files within a feature
| 84
| 12
|
159,870
|
protected void processLAandLI ( File archive , RepositoryResourceWritable resource , Manifest manifest ) throws RepositoryException , IOException { Attributes attribs = manifest . getMainAttributes ( ) ; String LAHeader = attribs . getValue ( LA_HEADER_PRODUCT ) ; String LIHeader = attribs . getValue ( LI_HEADER_PRODUCT ) ; processLAandLI ( archive , resource , LAHeader , LIHeader ) ; }
|
Locate and process license agreement and information files within a jar
| 98
| 12
|
159,871
|
public List < String > getRequiresFeature ( ArtifactMetadata amd ) { // Now check we have non-null input. I would like to check for valid // features // but as these may be user created I cannot find any way to do this so // it // is important there are no typos in the requires feature list TODO ? List < String > requiresFeature = new ArrayList < String > ( ) ; String requiresFeatureProp = amd . getProperty ( PROP_REQUIRE_FEATURE ) ; if ( requiresFeatureProp == null ) { return null ; } if ( requiresFeatureProp . equals ( "" ) ) { return requiresFeature ; } else { String [ ] features = requiresFeatureProp . split ( "\\," ) ; for ( String feature : features ) { requiresFeature . add ( feature . trim ( ) ) ; } return requiresFeature ; } }
|
Take the require . feature comma separated list and return a List of the entries
| 180
| 15
|
159,872
|
protected void processIcons ( ArtifactMetadata amd , RepositoryResourceWritable res ) throws RepositoryException { String current = "" ; String sizeString = "" ; String iconName = "" ; String iconNames = amd . getIcons ( ) ; if ( iconNames != null ) { iconNames . replaceAll ( "\\s" , "" ) ; StringTokenizer s = new StringTokenizer ( iconNames , "," ) ; while ( s . hasMoreTokens ( ) ) { current = s . nextToken ( ) ; int size = 0 ; if ( current . contains ( ";" ) ) { // if the icon has an associated // size StringTokenizer t = new StringTokenizer ( current , ";" ) ; while ( t . hasMoreTokens ( ) ) { sizeString = t . nextToken ( ) ; if ( sizeString . contains ( "size=" ) ) { String sizes [ ] = sizeString . split ( "size=" ) ; size = Integer . parseInt ( sizes [ sizes . length - 1 ] ) ; } else { iconName = sizeString ; } } } else { iconName = current ; } File icon = this . extractFileFromArchive ( amd . getArchive ( ) . getAbsolutePath ( ) , iconName ) . getExtractedFile ( ) ; if ( icon . exists ( ) ) { AttachmentResourceWritable at = res . addAttachment ( icon , AttachmentType . THUMBNAIL ) ; if ( size != 0 ) { at . setImageDimensions ( size , size ) ; } } else { throw new RepositoryArchiveEntryNotFoundException ( "Icon does not exist" , amd . getArchive ( ) , iconName ) ; } } } }
|
Process icons from the properties file
| 367
| 6
|
159,873
|
public void registerLink ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerLink" ) ; // Tell TRM that the link exists try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Register MQLink: " + getUuid ( ) + ", with mqLinkManager" ) ; _mqLinkManager . define ( getUuid ( ) ) ; } catch ( LinkException e ) { //Error during create of the link. Trace an FFST and exit FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MQLinkHandler.registerLink" , "1:804:1.71" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerLink" , e ) ; throw new SIResourceException ( e ) ; } //Register the link with TRM registerDestination ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerLink" ) ; }
|
Registers the link with WLM
| 302
| 7
|
159,874
|
public void deregisterLink ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deregisterLink" ) ; //Deregister the link with TRM deregisterDestination ( ) ; // Tell TRM that the link should be undefined if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Deregister MQLink: " + getUuid ( ) + ", with mqLinkManager" ) ; _mqLinkManager . undefine ( getUuid ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deregisterLink" ) ; }
|
De - registers the link from WLM
| 184
| 8
|
159,875
|
public void stop ( int mode ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "stop" ) ; super . stop ( mode ) ; // Signal the MQLink component to stop try { if ( _mqLinkObject != null ) _mqLinkObject . stop ( ) ; } catch ( SIResourceException e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; // The MQLink component will have FFDC'd we'll trace // the problem but allow processing to continue } catch ( SIException e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; // The MQLink component will have FFDC'd we'll trace // the problem but allow processing to continue } _mqLinkManager . undefine ( getUuid ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "stop" ) ; }
|
This stop method overrides the stop method in BaseDestinationHandler and is driven when the ME is stopped . As well as performing the normal stop processing for the MQLink object it also ensures that the uuid of the the MQLink is undefined from the set managed by the TRM . Otherwise there is the potential to add the uuid of the same MQLink twice .
| 230
| 78
|
159,876
|
public void announceMPStarted ( int startMode , JsMessagingEngine me ) throws SIResourceException , SIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "announceMPStarted" , new Object [ ] { startMode , me } ) ; // Drive mpStarted against the associated MQLink object if ( _mqLinkObject != null ) _mqLinkObject . mpStarted ( startMode , me ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "announceMPStarted" ) ; }
|
Alert the MQLink and PSB components that MP has now started .
| 154
| 15
|
159,877
|
public void destroy ( ) throws SIResourceException , SIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "destroy" ) ; // Drive destroy against the associated MQLink object if ( _mqLinkObject != null ) _mqLinkObject . destroy ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "destroy" ) ; }
|
Alert the MQLink and PSB components that destroy has been driven .
| 114
| 15
|
159,878
|
void recycle ( ) { flushed = false ; closed = false ; out = null ; nextChar = 0 ; converterBuffer . clear ( ) ; //PM19500 response = null ; //PM23029 }
|
Package - level access
| 42
| 4
|
159,879
|
public final void clear ( ) throws IOException { if ( ( bufferSize == 0 ) && ( out != null ) ) // clear() is illegal after any unbuffered output (JSP.5.5) throw new IllegalStateException ( "jsp.error.ise_on_clear" ) ; if ( flushed ) throw new IOException ( "jsp.error.attempt_to_clear_flushed_buffer" ) ; // defect 312981 begin //ensureOpen(); if ( closed ) { throw new IOException ( "Stream closed" ) ; } // defect 312981 end nextChar = 0 ; }
|
Discard the output buffer .
| 133
| 6
|
159,880
|
public static File [ ] getUserExtensionVersionFiles ( File installDir ) { File [ ] versionFiles = null ; String userDirLoc = System . getenv ( BootstrapConstants . ENV_WLP_USER_DIR ) ; File userDir = ( userDirLoc != null ) ? new File ( userDirLoc ) : ( ( installDir != null ) ? new File ( installDir , "usr" ) : null ) ; if ( userDir != null && userDir . exists ( ) ) { File userExtVersionDir = new File ( userDir , "extension/lib/versions" ) ; if ( userExtVersionDir . exists ( ) ) { versionFiles = userExtVersionDir . listFiles ( versionFileFilter ) ; } } return versionFiles ; }
|
Retrieves the product extension jar bundles located in the installation s usr directory .
| 165
| 17
|
159,881
|
private String getUserFromUniqueID ( String id ) { if ( id == null ) { return "" ; } id = id . trim ( ) ; int realmDelimiterIndex = id . indexOf ( "/" ) ; if ( realmDelimiterIndex < 0 ) { return "" ; } else { return id . substring ( realmDelimiterIndex + 1 ) ; } }
|
New method added as an alternative of getUserFromUniqueId method of WSSecurityPropagationHelper
| 81
| 22
|
159,882
|
private void checkNotClosed ( ) throws SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkNotClosed" ) ; //Synchronize on the closed object to prevent it being changed while we check it. synchronized ( this ) { if ( _closed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" , "Connection Closed exception" ) ; SIMPConnectionUnavailableException e = new SIMPConnectionUnavailableException ( nls_cwsik . getFormattedMessage ( "DELIVERY_ERROR_SIRC_22" , // OBJECT_CLOSED_ERROR_CWSIP0091 new Object [ ] { _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; e . setExceptionReason ( SIRCConstants . SIRC0022_OBJECT_CLOSED_ERROR ) ; e . setExceptionInserts ( new String [ ] { _messageProcessor . getMessagingEngineName ( ) } ) ; throw e ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" ) ; }
|
Check if this connection has been closed . If it has a SIObjectClosedException is thrown .
| 301
| 20
|
159,883
|
void removeBrowserSession ( BrowserSessionImpl browser ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeBrowserSession" , browser ) ; synchronized ( _browsers ) { _browsers . remove ( browser ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeBrowserSession" ) ; }
|
This method simply removes a Browser Session from our list . It is generally called by the Browser Session as it is closing down .
| 105
| 25
|
159,884
|
void removeConsumerSession ( ConsumerSessionImpl consumer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeConsumerSession" , consumer ) ; synchronized ( _consumers ) { _consumers . remove ( consumer ) ; } _messageProcessor . removeConsumer ( consumer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeConsumerSession" ) ; }
|
This method simply removes a Consumer Session from our list . It is generally called by the Consumer Session as it is closing down .
| 114
| 25
|
159,885
|
void removeProducerSession ( ProducerSessionImpl producer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeProducerSession" ) ; synchronized ( _producers ) { _producers . remove ( producer ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeProducerSession" ) ; }
|
This method simply removes a Producer Session from our list . It is generally called by the Producer Session as it is closing down .
| 104
| 25
|
159,886
|
private ProducerSession internalCreateProducerSession ( SIDestinationAddress destAddress , DestinationType destinationType , boolean system , SecurityContext secContext , boolean keepSecurityUserid , boolean fixedMessagePoint , boolean preferLocal , boolean clearPubSubFingerprints , String discriminator ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SITemporaryDestinationNotFoundException , SIIncorrectCallException , SIResourceException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "internalCreateProducerSession" , new Object [ ] { destAddress , destinationType , system , secContext , keepSecurityUserid , fixedMessagePoint , preferLocal , clearPubSubFingerprints } ) ; String destinationName = destAddress . getDestinationName ( ) ; String busName = destAddress . getBusName ( ) ; DestinationHandler destination = _destinationManager . getDestination ( destinationName , busName , false , true ) ; // Check the destination type checkDestinationType ( destinationType , destAddress , destination , system ) ; // Check authority to produce to destination // If security is disabled then we'll bypass the check // Security changes for Liberty Messaging: Sharath Start // Remove the If condition, since the proxy class handles it checkDestinationAuthority ( destination , MessagingSecurityConstants . OPERATION_TYPE_SEND , discriminator ) ; // Security changes for Liberty Messaging: Sharath End ProducerSession producer = null ; // Synchronize on the close object, we don't want the connection closing // while we try to add the producer. synchronized ( this ) { // See if this connection has been closed checkNotClosed ( ) ; producer = new ProducerSessionImpl ( destAddress , destination , this , secContext , keepSecurityUserid , fixedMessagePoint , preferLocal , clearPubSubFingerprints ) ; synchronized ( _producers ) { //store a reference to that producer session so that we can close //it again later if needed _producers . add ( producer ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalCreateProducerSession" , producer ) ; return producer ; //169892 }
|
Method that creates the producer session .
| 508
| 7
|
159,887
|
private void checkTemporary ( DestinationHandler destination , boolean mqinterop ) throws SITemporaryDestinationNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkTemporary" , new Object [ ] { destination , Boolean . valueOf ( mqinterop ) } ) ; // If a Temporary Destination, ensure it is on this connection unless mqinterop if ( destination . isTemporary ( ) && ! mqinterop && ( _temporaryDestinations . indexOf ( destination . getName ( ) ) == - 1 ) ) { SIMPTemporaryDestinationNotFoundException e = new SIMPTemporaryDestinationNotFoundException ( nls . getFormattedMessage ( "TEMPORARY_DESTINATION_CONNECTION_ERROR_CWSIP0099" , new Object [ ] { destination . getName ( ) } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "checkTemporary" , e ) ; } throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkTemporary" ) ; }
|
Checks to see if the destination is temporary and the connection used to create the temp destination is the same as the one trying to access it .
| 298
| 29
|
159,888
|
private ConsumerSession internalCreateConsumerSession ( SIDestinationAddress destAddr , String alternateUser , DestinationType destinationType , SelectionCriteria criteria , Reliability reliability , boolean enableReadAhead , boolean nolocal , boolean forwardScanning , boolean system , Reliability unrecoverableReliability , boolean bifurcatable , boolean mqinterop , boolean ignoreInitialIndoubts , boolean gatherMessages ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIErrorException , SINotAuthorizedException , SIIncorrectCallException , SIDestinationLockedException , SINotPossibleInCurrentConfigurationException , SITemporaryDestinationNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "internalCreateConsumerSession" , new Object [ ] { destAddr , alternateUser , destinationType , criteria , reliability , Boolean . valueOf ( enableReadAhead ) , Boolean . valueOf ( nolocal ) , Boolean . valueOf ( forwardScanning ) , Boolean . valueOf ( system ) , unrecoverableReliability , Boolean . valueOf ( bifurcatable ) , Boolean . valueOf ( mqinterop ) , Boolean . valueOf ( ignoreInitialIndoubts ) , Boolean . valueOf ( gatherMessages ) } ) ; try { return internalCreateConsumerSession ( null , destAddr , alternateUser , destinationType , criteria , reliability , enableReadAhead , nolocal , forwardScanning , system , unrecoverableReliability , bifurcatable , mqinterop , ignoreInitialIndoubts , gatherMessages ) ; } finally { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "internalCreateConsumerSession" ) ; } }
|
Internal method for creating the consumer .
| 430
| 7
|
159,889
|
private SIBusMessage internalReceiveNoWait ( SITransaction tran , Reliability unrecoverableReliability , SIDestinationAddress destAddr , DestinationType destinationType , SelectionCriteria criteria , Reliability reliability , String alternateUser , boolean system ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIDestinationLockedException , SITemporaryDestinationNotFoundException , SIResourceException , SIErrorException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "internalReceiveNoWait" , new Object [ ] { destAddr , alternateUser , destinationType , criteria , tran , reliability , unrecoverableReliability , Boolean . valueOf ( system ) } ) ; if ( destAddr == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , "SIIncorrectCallException - null destAddr" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "RECEIVE_NO_WAIT_CWSIR0091" , null , null ) ) ; } SIBusMessage message = null ; if ( tran != null && ! ( ( TransactionCommon ) tran ) . isAlive ( ) ) { SIIncorrectCallException e = new SIIncorrectCallException ( nls . getFormattedMessage ( "TRANSACTION_RECEIVE_USAGE_ERROR_CWSIP0777" , new Object [ ] { destAddr } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , e ) ; throw e ; } try { //TODO there may be some optimization we can do here to just receive one message //Create a consumer session ConsumerSession session = internalCreateConsumerSession ( destAddr , alternateUser , destinationType , criteria , reliability , false , //enableReadAhead false , //noLocal false , //forwardScanning system , unrecoverableReliability , false , // bifurcatable false , // mqInterop true , // ignoreIntialIndoubts false // gatherMessages ) ; session . start ( false ) ; //receive one message message = session . receiveNoWait ( tran ) ; //close the session session . close ( ) ; } catch ( SISessionUnavailableException e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; // If any of these calls failed due to being closed the connection // must have been closed. Call checkNotClosed() to force out the // correct exception. checkNotClosed ( ) ; // Just in case the connection isn't closed we better re-throw the // original exception. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , e ) ; throw new SIMPConnectionUnavailableException ( nls_cwsik . getFormattedMessage ( "DELIVERY_ERROR_SIRC_22" , // OBJECT_CLOSED_ERROR_CWSIP0091 new Object [ ] { _messageProcessor . getMessagingEngineName ( ) } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , message ) ; return message ; }
|
Internal implementation for receiving no wait
| 839
| 6
|
159,890
|
private BrowserSession createBrowserSession ( SIDestinationAddress destinationAddress , DestinationType destinationType , SelectionCriteria criteria , boolean system , String alternateUser , boolean gatherMessages ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SITemporaryDestinationNotFoundException , SIResourceException , SINotPossibleInCurrentConfigurationException , SISelectorSyntaxException , SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createBrowserSession" , new Object [ ] { destinationAddress , destinationType , criteria , Boolean . valueOf ( gatherMessages ) } ) ; // Finding a destination could take some time so we don't have the // connection locked (on closed) when we do this. DestinationHandler destination = _destinationManager . getDestination ( ( JsDestinationAddress ) destinationAddress , false ) ; // Check that this is the correct destination type checkDestinationType ( destinationType , destinationAddress , destination , system ) ; if ( destination . getDestinationType ( ) == DestinationType . SERVICE ) { //Cant browse a service destination if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createBrowserSession" , "cannot browse a service destination" ) ; throw new SINotPossibleInCurrentConfigurationException ( nls . getFormattedMessage ( "INVALID_DESTINATION_USAGE_ERROR_CWSIP0022" , new Object [ ] { destination . getName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } // Check that this temporary destination was created by this connection. checkTemporary ( destination , false ) ; // Check authority to browse this destination // If security is disabled then we'll bypass the check checkDestinationAuthority ( destination , MessagingSecurityConstants . OPERATION_TYPE_BROWSE , null ) ; //if the destination turns out to be pub-sub then that doesn't make sense //so we'll just set it back to null if ( destination . isPubSub ( ) ) { destination = null ; } BrowserSession browser = null ; // Synchronize on the close object, we don't want the connection closing // while we try to add the browser. synchronized ( this ) { // See if this connection has been closed checkNotClosed ( ) ; //create a browser session with the given destination //if the destination was null - it was pub sub - this will create a browser //session which never returns any messages browser = new BrowserSessionImpl ( destination , criteria , this , destinationAddress , gatherMessages ) ; synchronized ( _browsers ) { //store a reference _browsers . add ( browser ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createBrowserSession" , browser ) ; return browser ; }
|
Creates the Browser session .
| 660
| 6
|
159,891
|
private static final boolean isDestinationPrefixValid ( String destinationPrefix ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isDestinationPrefixValid" , destinationPrefix ) ; boolean isValid = true ; // Assume the prefix is valid until we know otherwise. // null indicates that no destination prefix is being used. if ( null != destinationPrefix ) { // Check for the length first. int len = destinationPrefix . length ( ) ; if ( len > 24 ) { isValid = false ; } else { // Cycle through each character in the prefix until we find an invalid character, // or until we come to the end of the string. int along = 0 ; while ( ( along < len ) && isValid ) { char c = destinationPrefix . charAt ( along ) ; if ( ! ( ( ' ' <= c ) && ( ' ' >= c ) ) ) { if ( ! ( ( ' ' <= c ) && ( ' ' >= c ) ) ) { if ( ! ( ( ' ' <= c ) && ( ' ' >= c ) ) ) { if ( ' ' != c && ' ' != c && ' ' != c ) { // This character isn't a valid one... isValid = false ; } } } } // Move along to the next character in the string. along += 1 ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isDestinationPrefixValid" , Boolean . valueOf ( isValid ) ) ; return isValid ; }
|
Determines whether a destination prefix for a System destination is valid or not .
| 355
| 16
|
159,892
|
@ Override public ItemStream getMQLinkPubSubBridgeItemStream ( String mqLinkUuidStr ) throws SIException { MQLinkHandler mqLinkHandler = null ; ItemStream mqLinkPubSubBridgeItemStream = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMQLinkPubSubBridgeItemStream" , mqLinkUuidStr ) ; // See if this connection has been closed checkNotClosed ( ) ; if ( mqLinkUuidStr == null ) { SIIncorrectCallException e = new SIIncorrectCallException ( nls . getFormattedMessage ( "MISSING_PARAM_ERROR_CWSIP0029" , new Object [ ] { "1:5583:1.347.1.25" } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "getMQLinkPubSubBridgeItemStream" , e ) ; } throw e ; } SIBUuid8 mqLinkUuid = new SIBUuid8 ( mqLinkUuidStr ) ; // Get the destination. It must be localised on this ME mqLinkHandler = _destinationManager . getMQLinkLocalization ( mqLinkUuid , false ) ; // Check the destination type if ( mqLinkHandler == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMQLinkPubSubBridgeItemStream" , "SINotPossibleInCurrentConfigurationException" ) ; throw new SINotPossibleInCurrentConfigurationException ( nls . getFormattedMessage ( "MQLINK_PSB_ERROR_CWSIP0027" , new Object [ ] { mqLinkUuid , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } // Got the right kind of handler, now get its itemstream mqLinkPubSubBridgeItemStream = mqLinkHandler . getMqLinkPubSubBridgeItemStream ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMQLinkPubSubBridgeItemStream" , mqLinkPubSubBridgeItemStream ) ; return mqLinkPubSubBridgeItemStream ; }
|
Retrieves the MQLink s PubSubBridge ItemStream
| 555
| 13
|
159,893
|
void removeBifurcatedConsumerSession ( BifurcatedConsumerSessionImpl bifurcatedConsumer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConnection . tc , "removeBifurcatedConsumerSession" , new Object [ ] { this , bifurcatedConsumer } ) ; // Remove the consumer from the list. synchronized ( _bifurcatedConsumers ) { _bifurcatedConsumers . remove ( bifurcatedConsumer ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIConnection . tc , "removeBifurcatedConsumerSession" ) ; }
|
Remove a bifurcated consumer from the connection list .
| 192
| 13
|
159,894
|
private boolean checkConsumerDiscriminatorAccess ( DestinationHandler destination , String discriminator , SecurityContext secContext ) throws SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkConsumerDiscriminatorAccess" , new Object [ ] { destination , discriminator , secContext } ) ; boolean allowed = true ; // If the discriminator is non-wildcarded, we can check authority to consume on // the discriminator. if ( discriminator != null && ! _messageProcessor . getMessageProcessorMatching ( ) . isWildCarded ( discriminator ) ) { // set the discriminator into the security context secContext . setDiscriminator ( discriminator ) ; if ( ! destination . checkDiscriminatorAccess ( secContext , OperationType . RECEIVE ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkConsumerDiscriminatorAccess" , "not authorized to consume from this destination's discriminator" ) ; // Write an audit record if access is denied SibTr . audit ( tc , nls . getFormattedMessage ( "USER_NOT_AUTH_RECEIVE_ERROR_CWSIP0310" , new Object [ ] { destination . getName ( ) , discriminator , secContext . getUserName ( false ) } , null ) ) ; allowed = false ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkConsumerDiscriminatorAccess" , Boolean . valueOf ( allowed ) ) ; return allowed ; }
|
Checks the authority of a consumer to consume from a discriminator
| 375
| 13
|
159,895
|
private void checkInquireAuthority ( DestinationHandler destination , String destinationName , String busName , SecurityContext secContext , boolean temporary ) throws SINotAuthorizedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkInquireAuthority" , new Object [ ] { destination , destinationName , busName , secContext , Boolean . valueOf ( temporary ) } ) ; // Check authority to inquire on the destination if ( ! temporary ) // Non-temorary destination access check { if ( ! destination . checkDestinationAccess ( secContext , OperationType . INQUIRE ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkInquireAuthority" , "not authorized to inquire on this destination" ) ; // Get the username String userName = secContext . getUserName ( true ) ; //Messaging varies dependent on bus versus destination access check String nlsMessage ; if ( destinationName != null ) { // Build the message for the Exception and the Notification nlsMessage = nls . getFormattedMessage ( "USER_NOT_AUTH_INQUIRE_ERROR_CWSIP0314" , new Object [ ] { destinationName , userName } , null ) ; // Fire a Notification if Eventing is enabled _accessChecker . fireDestinationAccessNotAuthorizedEvent ( destinationName , userName , OperationType . INQUIRE , nlsMessage ) ; } else // foreign bus access { // Build the message for the Exception and the Notification nlsMessage = nls . getFormattedMessage ( "USER_NOT_AUTH_INQUIRE_FB_ERROR_CWSIP0315" , new Object [ ] { busName , userName } , null ) ; // Fire a Notification if Eventing is enabled _accessChecker . fireDestinationAccessNotAuthorizedEvent ( busName , userName , OperationType . INQUIRE , nlsMessage ) ; } // Thrown if user denied access to destination throw new SINotAuthorizedException ( nlsMessage ) ; } } else // Check authority to inquire on temp topic { // get the temp prefix from the destination name String destinationPrefix = SIMPUtils . parseTempPrefix ( destinationName ) ; if ( ! _accessChecker . checkTemporaryDestinationAccess ( secContext , destinationName , // name of destination ( destinationPrefix == null ) ? "" : destinationPrefix , // sib.security wants empty string if prefix is null OperationType . INQUIRE ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkInquireAuthority" , "not authorized to inquire on temporary destination" ) ; // Get the username String userName = secContext . getUserName ( true ) ; // Build the message for the Exception and the Notification String nlsMessage = nls . getFormattedMessage ( "USER_NOT_AUTH_INQUIRE_ERROR_CWSIP0314" , new Object [ ] { destinationPrefix , userName } , null ) ; // Fire a Notification if Eventing is enabled _accessChecker . fireDestinationAccessNotAuthorizedEvent ( destinationPrefix , userName , OperationType . INQUIRE , nlsMessage ) ; // Thrown if user denied access to destination throw new SINotAuthorizedException ( nlsMessage ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkInquireAuthority" ) ; }
|
Checks the authority to inquire on a destination
| 789
| 9
|
159,896
|
private boolean isSIBServerSubject ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isSIBServerSubject" ) ; boolean ispriv = false ; if ( _subject != null ) ispriv = _messageProcessor . getAuthorisationUtils ( ) . isSIBServerSubject ( _subject ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isSIBServerSubject" , Boolean . valueOf ( ispriv ) ) ; return ispriv ; }
|
Returns true if the subject associated with the connection is the privileged SIBServerSubject .
| 139
| 17
|
159,897
|
@ Override public boolean isMulticastEnabled ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isMulticastEnabled" ) ; boolean enabled = _messageProcessor . isMulticastEnabled ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isMulticastEnabled" , Boolean . valueOf ( enabled ) ) ; return enabled ; }
|
Returns true if multicast is enabled
| 117
| 7
|
159,898
|
@ Override public MulticastProperties getMulticastProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMulticastProperties" ) ; MulticastProperties props = _messageProcessor . getMulticastProperties ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMulticastProperties" , props ) ; return props ; }
|
Returns the MulticastProperties for this messaging engine null if multicast is not enabled .
| 123
| 19
|
159,899
|
private void checkDestinationAccess ( DestinationHandler destination , String destinationName , String busName , SecurityContext secContext ) throws SINotAuthorizedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkDestinationAccess" , new Object [ ] { destination , destinationName , busName , secContext } ) ; // Check authority to produce to destination if ( ! destination . checkDestinationAccess ( secContext , OperationType . SEND ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDestinationAccess" , "not authorized to produce to this destination" ) ; // Thrown if user denied access to destination SIMPNotAuthorizedException e = new SIMPNotAuthorizedException ( nls_cwsik . getFormattedMessage ( "DELIVERY_ERROR_SIRC_18" , // USER_NOT_AUTH_SEND_ERROR_CWSIP0306 new Object [ ] { destinationName , secContext . getUserName ( false ) } , null ) ) ; e . setExceptionReason ( SIRCConstants . SIRC0018_USER_NOT_AUTH_SEND_ERROR ) ; e . setExceptionInserts ( new String [ ] { destinationName , secContext . getUserName ( false ) } ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDestinationAccess" ) ; }
|
Checks the authority of a producer to produce to a destination
| 352
| 12
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.