idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
24,800
public void visit ( int version , int access , String classResourceName , String signature , String superClassResourceName , String interfaceResourceNames [ ] ) { Object [ ] logParms ; if ( tc . isDebugEnabled ( ) ) { logParms = new Object [ ] { getHashText ( ) , classResourceName } ; Tr . debug ( tc , MessageFormat . format ( "[ {0} ] [ {1} ]" , logParms ) ) ; } else { logParms = null ; } String className = getClassNameFromPartialResourceName ( classResourceName ) ; if ( logParms != null ) { logParms [ 1 ] = className + ".class" ; } if ( isPackageName ( className ) ) { if ( ( logParms != null ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] [ {1} ] Package load" , logParms ) ) ; } isClass = false ; className = stripPackageNameFromClassName ( className ) ; String externalClassName = stripPackageNameFromClassName ( getExternalName ( ) ) ; if ( ! className . equals ( externalClassName ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Class name mismatch" , getHashText ( ) , externalClassName ) ; } throw VISIT_ENDED_PACKAGE_MISMATCH ; } i_className = internClassName ( className , Util_InternMap . DO_FORCE ) ; } else { if ( logParms != null && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] [ {1} ] Class load" , logParms ) ) ; } isClass = true ; if ( ! className . equals ( getExternalName ( ) ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Class name mismatch" , getHashText ( ) , className ) ; } throw VISIT_ENDED_CLASS_MISMATCH ; } i_className = internClassName ( className ) ; if ( ! i_recordScannedClassName ( i_className ) ) { Tr . warning ( tc , "ANNO_TARGETS_DUPLICATE_CLASS" , getHashText ( ) , i_className ) ; throw VISIT_ENDED_DUPLICATE_CLASS ; } i_removeReferencedClassName ( i_className ) ; if ( superClassResourceName != null ) { superClassResourceName = getClassNameFromPartialResourceName ( superClassResourceName ) ; String i_superclassName = internClassName ( superClassResourceName ) ; i_recordSuperclassName ( i_className , i_superclassName ) ; i_recordReferencedClassName ( i_superclassName ) ; } if ( ( interfaceResourceNames != null ) && ( interfaceResourceNames . length > 0 ) ) { String [ ] i_interfaceNames = new String [ interfaceResourceNames . length ] ; for ( int nameNo = 0 ; nameNo < interfaceResourceNames . length ; nameNo ++ ) { String nextInterfaceResourceName = interfaceResourceNames [ nameNo ] ; String nextInterfaceName = getClassNameFromPartialResourceName ( nextInterfaceResourceName ) ; String i_nextInterfaceName = internClassName ( nextInterfaceName ) ; i_interfaceNames [ nameNo ] = i_nextInterfaceName ; } i_recordInterfaceNames ( i_className , i_interfaceNames ) ; for ( String i_interfaceName : i_interfaceNames ) { i_recordReferencedClassName ( i_interfaceName ) ; } } } }
Note that the names are resource names .
24,801
public AnnotationVisitor visitAnnotation ( String desc , boolean visible ) { AnnotationCategory category = ( isClass ? AnnotationCategory . CLASS : AnnotationCategory . PACKAGE ) ; recordAnnotation ( category , desc ) ; return null ; }
is recorded .
24,802
public FieldVisitor visitField ( int access , String name , String desc , String signature , Object defaultValue ) { if ( scanPolicyIsExternal ( ) || ! isDetailEnabled ( ) ) { visitEnd ( ) ; throw VISIT_ENDED_DETAIL ; } return fieldVisitor ; }
visiting the field .
24,803
public MethodVisitor visitMethod ( int access , String name , String desc , String signature , String exceptions [ ] ) { if ( scanPolicyIsExternal ( ) || ! isDetailEnabled ( ) ) { visitEnd ( ) ; throw VISIT_ENDED_DETAIL ; } return methodVisitor ; }
visiting the method .
24,804
private void mergeWebServicesBndInfo ( WebServiceRefInfo wsrInfo , JaxWsClientMetaData jaxwsClientMetaData ) { WebservicesBnd webServicesBnd = null ; try { webServicesBnd = jaxwsClientMetaData . getModuleMetaData ( ) . getModuleContainer ( ) . adapt ( WebservicesBnd . class ) ; } catch ( UnableToAdaptException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Can not get the custom binding file due to {0}" , e ) ; } return ; } if ( webServicesBnd != null ) { String componenetName = wsrInfo . getComponenetName ( ) ; com . ibm . ws . javaee . ddmodel . wsbnd . ServiceRef serviceRef = webServicesBnd . getServiceRef ( wsrInfo . getJndiName ( ) , componenetName ) ; if ( serviceRef != null ) { List < Port > portList = serviceRef . getPorts ( ) ; if ( portList != null && portList . size ( ) > 0 ) { for ( Port port : portList ) { QName portQName = port . getPortQName ( ) ; PortComponentRefInfo portInfo = new PortComponentRefInfo ( portQName ) ; portInfo . setAddress ( port . getAddress ( ) ) ; portInfo . setUserName ( port . getUserName ( ) ) ; portInfo . setPassword ( port . getPassword ( ) ) ; portInfo . setSSLRef ( port . getSSLRef ( ) ) ; portInfo . setKeyAlias ( port . getKeyAlias ( ) ) ; portInfo . setProperties ( port . getProperties ( ) ) ; wsrInfo . addPortComponentRefInfo ( portInfo ) ; } } wsrInfo . setDefaultPortAddress ( serviceRef . getPortAddress ( ) ) ; wsrInfo . setProperties ( serviceRef . getProperties ( ) ) ; String wsdlOverride = serviceRef . getWsdlLocation ( ) ; if ( wsdlOverride != null && ! wsdlOverride . isEmpty ( ) ) { wsrInfo . setWsdlLocation ( wsdlOverride ) ; } } } }
merge the configurations from the ibm - ws - bnd . xml
24,805
@ Generated ( value = "com.ibm.jtc.jax.tools.xjc.Driver" , date = "2014-06-11T05:49:00-04:00" , comments = "JAXB RI v2.2.3-11/28/2011 06:21 AM(foreman)-" ) public List < ExceptionClassFilter . Include > getIncludeList ( ) { if ( includeList == null ) { includeList = new ArrayList < ExceptionClassFilter . Include > ( ) ; } return this . includeList ; }
Gets the value of the includeList property .
24,806
@ Generated ( value = "com.ibm.jtc.jax.tools.xjc.Driver" , date = "2014-06-11T05:49:00-04:00" , comments = "JAXB RI v2.2.3-11/28/2011 06:21 AM(foreman)-" ) public List < ExceptionClassFilter . Exclude > getExcludeList ( ) { if ( excludeList == null ) { excludeList = new ArrayList < ExceptionClassFilter . Exclude > ( ) ; } return this . excludeList ; }
Gets the value of the excludeList property .
24,807
public void addDependency ( Vertex < T > v ) { if ( ! m_dependencies . contains ( v ) ) { m_dependencies . add ( v ) ; } }
Add a dependecy to this Vertex . The Vertex that this one depends on will be marked as referenced and then added to the list of dependencies . The list is checked before the dependency is added .
24,808
private int resolveOrder ( String path ) throws CyclicDependencyException { m_seen = true ; try { int highOrder = - 1 ; for ( Vertex < T > dv : m_dependencies ) { if ( dv . m_seen ) { throw new CyclicDependencyException ( path + " -> " + dv . getName ( ) ) ; } else { highOrder = Math . max ( highOrder , dv . resolveOrder ( path + " -> " + dv . getName ( ) ) ) ; } } m_order = highOrder + 1 ; return m_order ; } finally { m_seen = false ; } }
Recursively searches for cycles by travelling down the dependency lists of this vertex looking for the start vertex .
24,809
public int compareTo ( final Vertex < T > o ) { int orderInd ; if ( m_order < o . m_order ) { orderInd = - 1 ; } else if ( m_order > o . m_order ) { orderInd = 1 ; } else { orderInd = 0 ; } return orderInd ; }
Used in the sort algorithm to sort all the Vertices so that they respect the ordinal they were given during the topological sort .
24,810
public static Logger getLogger ( String className , String groupName ) { Logger logger = Logger . getLogger ( className ) ; if ( ! svCheckedForWAS ) { try { Class loggerHelperClass = Class . forName ( "com.ibm.ws.logging.LoggerHelper" ) ; svAddLoggerToGroupMethod = loggerHelperClass . getMethod ( "addLoggerToGroup" , new Class [ ] { Logger . class , String . class } ) ; } catch ( Exception ex ) { svLogger . logp ( Level . FINE , CLASS_NAME , "getLogger" , "failed to find addLoggerToGroup method" , ex ) ; } svCheckedForWAS = true ; } if ( svAddLoggerToGroupMethod != null ) { try { svAddLoggerToGroupMethod . invoke ( null , new Object [ ] { logger , groupName } ) ; } catch ( IllegalAccessException ex ) { svLogger . logp ( Level . FINE , CLASS_NAME , "getLogger" , "addLoggerToGroup failed" , ex ) ; } catch ( InvocationTargetException ex ) { svLogger . logp ( Level . FINE , CLASS_NAME , "getLogger" , "addLoggerToGroup failed" , ex ) ; } } return logger ; }
Gets a new logger and registers it with the specified Tr logging group .
24,811
public static ArrayList < ConfigSource > getDiscoveredSources ( ClassLoader classloader ) { ArrayList < ConfigSource > sources = new ArrayList < > ( ) ; try { ServiceLoader < ConfigSource > sl = ServiceLoader . load ( ConfigSource . class , classloader ) ; for ( ConfigSource source : sl ) { sources . add ( source ) ; } } catch ( ServiceConfigurationError e ) { throw new ConfigException ( Tr . formatMessage ( tc , "unable.to.discover.config.sources.CWMCG0010E" , e ) , e ) ; } try { ServiceLoader < ConfigSourceProvider > providerSL = ServiceLoader . load ( ConfigSourceProvider . class , classloader ) ; for ( ConfigSourceProvider provider : providerSL ) { for ( ConfigSource source : provider . getConfigSources ( classloader ) ) { sources . add ( source ) ; } } } catch ( ServiceConfigurationError e ) { throw new ConfigException ( Tr . formatMessage ( tc , "unable.to.discover.config.source.providers.CWMCG0011E" , e ) , e ) ; } return sources ; }
Get ConfigSources found using the ServiceLoader pattern - both directly as found ConfigSources and those found via found ConfigSourceProviders getConfigSources method .
24,812
private static byte getBeanType ( BeanMetaData bmd , boolean isHome ) { if ( isHome ) { if ( bmd != null && bmd . _moduleMetaData . isVersionedModule ( ) ) { return HOME_BEAN | MODULE_VERSION_CAPABLE ; } return HOME_BEAN ; } byte typeId = TYPE_TO_TYPE_ID_MAP [ bmd . type ] ; if ( bmd . usesBeanManagedTx ) { typeId |= USES_BEAN_MANAGED_TX ; } if ( bmd . _moduleMetaData . isVersionedModule ( ) ) { typeId |= MODULE_VERSION_CAPABLE ; } return typeId ; }
Returns the bean type id for serialization .
24,813
protected static byte [ ] getJ2EENameBytes ( byte [ ] bytes ) throws CSIException { boolean isHome = false ; byte [ ] j2eeNameBytes = null ; for ( int i = 0 ; i < HEADER_LEN ; i ++ ) { if ( bytes [ i ] != header [ i ] ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Header mismatch, attempting to deserialize BeanId" ) ; throw new CSIException ( "Parser Error: header mismatch" ) ; } } switch ( bytes [ HEADER_LEN ] ) { case HOME_BEAN : isHome = true ; case STATEFUL_BEAN : case STATEFUL_BEAN + USES_BEAN_MANAGED_TX : case ENTITY_BEAN : case SINGLETON_BEAN : case SINGLETON_BEAN + USES_BEAN_MANAGED_TX : case STATELESS_BEAN : case STATELESS_BEAN + USES_BEAN_MANAGED_TX : case MESSAGEDRIVEN_BEAN : case MESSAGEDRIVEN_BEAN + USES_BEAN_MANAGED_TX : j2eeNameBytes = readJ2EENameBytes ( bytes ) ; break ; default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: unsupported EJB type: " + bytes [ HEADER_LEN ] ) ; throw new CSIException ( "Unsupported EJB Type: " + bytes [ HEADER_LEN ] ) ; } if ( isHome ) { try { int pkeyIndex = HEADER_LEN + BEAN_TYPE_LEN + J2EE_NAME_LEN + j2eeNameBytes . length ; j2eeNameBytes = ( byte [ ] ) readPKey ( bytes , pkeyIndex , null ) ; } catch ( Throwable th ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: home j2eeName: " + th ) ; throw new CSIException ( "Unable to read j2eeName bytes" , th ) ; } } return j2eeNameBytes ; }
d145400 . 1
24,814
protected static Serializable getPrimaryKey ( byte [ ] bytes ) throws CSIException { int pkeyIndex ; boolean isStateful = false ; Serializable pkey = null ; byte [ ] j2eeNameBytes = null ; J2EEName j2eeName = null ; for ( int i = 0 ; i < HEADER_LEN ; i ++ ) { if ( bytes [ i ] != header [ i ] ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Header mismatch, attempting to deserialize BeanId" ) ; throw new CSIException ( "Parser Error: header mismatch" ) ; } } switch ( bytes [ HEADER_LEN ] ) { case HOME_BEAN : case SINGLETON_BEAN : case SINGLETON_BEAN + USES_BEAN_MANAGED_TX : case STATELESS_BEAN : case STATELESS_BEAN + USES_BEAN_MANAGED_TX : case MESSAGEDRIVEN_BEAN : case MESSAGEDRIVEN_BEAN + USES_BEAN_MANAGED_TX : break ; case STATEFUL_BEAN : case STATEFUL_BEAN + USES_BEAN_MANAGED_TX : isStateful = true ; case ENTITY_BEAN : j2eeNameBytes = readJ2EENameBytes ( bytes ) ; j2eeName = EJSContainer . getDefaultContainer ( ) . getJ2EENameFactory ( ) . create ( j2eeNameBytes ) ; pkeyIndex = HEADER_LEN + BEAN_TYPE_LEN + J2EE_NAME_LEN + j2eeNameBytes . length ; try { pkey = readPKey ( bytes , pkeyIndex , j2eeName ) ; } catch ( Throwable th ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: primary key: " + th ) ; throw new CSIException ( "Unable to read primary key" , th ) ; } break ; default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: unsupported EJB type: " + bytes [ HEADER_LEN ] ) ; throw new CSIException ( "Unsupported EJB Type: " + bytes [ HEADER_LEN ] ) ; } if ( isStateful ) { pkey = EJSContainer . sessionKeyFactory . create ( ( byte [ ] ) pkey ) ; } return pkey ; }
LI2281 - 3
24,815
public final boolean useLSD ( ) { if ( _isHome ) { return true ; } else { BeanMetaData bmd = home . getBeanMetaData ( j2eeName ) ; if ( bmd . type == InternalConstants . TYPE_CONTAINER_MANAGED_ENTITY || bmd . type == InternalConstants . TYPE_SINGLETON_SESSION || bmd . type == InternalConstants . TYPE_STATELESS_SESSION || bmd . type == InternalConstants . TYPE_BEAN_MANAGED_ENTITY || bmd . ivSFSBFailover ) { return true ; } else { return false ; } } }
d121510 - added entire method .
24,816
private final ByteArrayOutputStream getByteArrayStream ( ) { ByteArrayOutputStream rtnBaos = null ; synchronized ( svBAOSs ) { if ( svBAOSsSize > 0 ) { -- svBAOSsSize ; rtnBaos = svBAOSs [ svBAOSsSize ] ; svBAOSs [ svBAOSsSize ] = null ; } } if ( rtnBaos == null ) { rtnBaos = new ByteArrayOutputStream ( ) ; } else { rtnBaos . reset ( ) ; } return rtnBaos ; }
Return the next available ByteArrayOutputStream object from the pool .
24,817
private final void freeByteArrayStream ( ByteArrayOutputStream baos ) { synchronized ( svBAOSs ) { if ( svBAOSsSize < svBAOSs . length ) { svBAOSs [ svBAOSsSize ] = baos ; ++ svBAOSsSize ; } } }
Return the input ByteArrayOutputStream back to the pool .
24,818
public static boolean isCertPathBuilderException ( Throwable cause ) { if ( cause == null ) return false ; if ( cause instanceof java . security . cert . CertPathBuilderException ) return true ; return isCertPathBuilderException ( cause . getCause ( ) ) ; }
Checks if cause is an instance of CertPathBuilderException
24,819
static InstallException createByKey ( int rc , String msgKey , Object ... args ) { return create ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( msgKey , args ) , rc ) ; }
Create an install exception from a return code and message key
24,820
static InstallException create ( String msg , Exception e ) { return create ( msg , e , InstallException . RUNTIME_EXCEPTION ) ; }
Create an install exception from an existing exception and a message
24,821
public static InstallException createFailedToDownload ( RepositoryResource installResource , Exception e , File toDir ) { String target = toDir == null ? System . getProperty ( "java.io.tmpdir" ) : toDir . getAbsolutePath ( ) ; if ( e instanceof IOException ) return ExceptionUtils . createByKey ( InstallException . IO_FAILURE , e , "ERROR_FAILED_DOWNLOAD_ASSETS_TO_TEMP" , InstallUtils . getResourceId ( installResource ) , InstallUtils . getResourceName ( installResource ) , target ) ; if ( e instanceof RepositoryBackendException ) { RepositoryConnection failingConnection = ( ( RepositoryBackendException ) e ) . getFailingConnection ( ) ; String repositoryLocation = failingConnection . getRepositoryLocation ( ) ; boolean isDefaultRepo = repositoryLocation . startsWith ( InstallConstants . REPOSITORY_LIBERTY_URL ) ; if ( ExceptionUtils . isCertPathBuilderException ( e . getCause ( ) ) ) return ExceptionUtils . createByKey ( e , isDefaultRepo ? "ERROR_FAILED_TO_CONNECT_CAUSED_BY_CERT" : "ERROR_FAILED_TO_CONNECT_REPO_CAUSED_BY_CERT" , repositoryLocation ) ; return ExceptionUtils . createByKey ( e , isDefaultRepo ? "ERROR_FAILED_TO_DOWNLOAD_ASSETS_FROM_DEFAULT_REPO" : "ERROR_FAILED_TO_DOWNLOAD_ASSETS_FROM_REPO" , InstallUtils . getResourceId ( installResource ) , InstallUtils . getResourceName ( installResource ) , repositoryLocation ) ; } if ( e instanceof RepositoryResourceException ) return ExceptionUtils . createByKey ( e , "ERROR_FAILED_TO_DOWNLOAD_ASSETS" , InstallUtils . getResourceId ( installResource ) , InstallUtils . getResourceName ( installResource ) ) ; if ( installResource . getType ( ) . equals ( ResourceType . FEATURE ) ) return createByKey ( InstallException . IO_FAILURE , e , "ERROR_FAILED_TO_DOWNLOAD_FEATURE" , installResource . getName ( ) , target ) ; if ( installResource . getType ( ) . equals ( ResourceType . IFIX ) ) return createByKey ( InstallException . IO_FAILURE , e , "ERROR_FAILED_TO_DOWNLOAD_IFIX" , installResource . getName ( ) , target ) ; if ( installResource . getType ( ) . equals ( ResourceType . PRODUCTSAMPLE ) ) return createByKey ( InstallException . IO_FAILURE , e , "ERROR_FAILED_TO_DOWNLOAD_SAMPLE" , installResource . getName ( ) , target ) ; if ( installResource . getType ( ) . equals ( ResourceType . OPENSOURCE ) ) return createByKey ( InstallException . IO_FAILURE , e , "ERROR_FAILED_TO_DOWNLOAD_OPENSOURCE" , installResource . getName ( ) , target ) ; return createByKey ( e , "ERROR_UNSUPPORTED" ) ; }
Create an install exception as a result of a fail to download exception
24,822
static InstallException create ( Exception e ) { if ( e instanceof ProductInfoParseException ) { ProductInfoParseException pipe = ( ProductInfoParseException ) e ; String missingKey = pipe . getMissingKey ( ) ; if ( missingKey != null ) { return create ( Messages . UTILITY_MESSAGES . getLogMessage ( "version.missing.key" , missingKey , pipe . getFile ( ) . getAbsoluteFile ( ) ) ) ; } return create ( Messages . UTILITY_MESSAGES . getLogMessage ( "ERROR_UNABLE_READ_FILE" , pipe . getFile ( ) . getAbsoluteFile ( ) , pipe . getCause ( ) . getMessage ( ) ) ) ; } if ( e instanceof DuplicateProductInfoException ) { DuplicateProductInfoException dpie = ( DuplicateProductInfoException ) e ; return create ( Messages . UTILITY_MESSAGES . getLogMessage ( "version.duplicated.productId" , ProductInfo . COM_IBM_WEBSPHERE_PRODUCTID_KEY , dpie . getProductInfo1 ( ) . getFile ( ) . getAbsoluteFile ( ) , dpie . getProductInfo2 ( ) . getFile ( ) . getAbsoluteFile ( ) ) ) ; } if ( e instanceof ProductInfoReplaceException ) { ProductInfoReplaceException pire = ( ProductInfoReplaceException ) e ; ProductInfo productInfo = pire . getProductInfo ( ) ; String replacesId = productInfo . getReplacesId ( ) ; if ( replacesId . equals ( productInfo . getId ( ) ) ) { return create ( Messages . UTILITY_MESSAGES . getLogMessage ( "version.replaced.product.can.not.itself" , productInfo . getFile ( ) . getAbsoluteFile ( ) ) ) ; } return create ( Messages . UTILITY_MESSAGES . getLogMessage ( "version.replaced.product.not.exist" , replacesId , productInfo . getFile ( ) . getAbsoluteFile ( ) ) ) ; } if ( e instanceof RepositoryBackendIOException ) { return create ( ( RepositoryException ) e , new Throwable ( e ) , ( RestRepositoryConnectionProxy ) null , true ) ; } return create ( e . getMessage ( ) , e , InstallException . RUNTIME_EXCEPTION ) ; }
Create an install exception from an existing exception
24,823
static InstallException create ( RepositoryException e , Throwable cause , RestRepositoryConnectionProxy proxy , boolean defaultRepo ) { if ( proxy != null && cause instanceof UnknownHostException ) return create ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_TOOL_UNKNOWN_PROXY_HOST" , proxy . getProxyURL ( ) . getHost ( ) ) , e ) ; else if ( cause instanceof ConnectException && cause . getMessage ( ) != null && cause . getMessage ( ) . contains ( "Connection refused" ) && proxy != null ) return create ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_TOOL_INCORRECT_PROXY_PORT" , String . valueOf ( proxy . getProxyURL ( ) . getPort ( ) ) ) , e ) ; else if ( isCertPathBuilderException ( cause ) ) return create ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( defaultRepo ? "ERROR_FAILED_TO_CONNECT_CAUSED_BY_CERT" : "ERROR_FAILED_TO_CONNECT_REPOS_CAUSED_BY_CERT" ) , e , InstallException . RUNTIME_EXCEPTION ) ; else return create ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( defaultRepo ? "ERROR_FAILED_TO_CONNECT" : "ERROR_FAILED_TO_CONNECT_REPOS" ) , e , InstallException . RUNTIME_EXCEPTION ) ; }
Create an install exception from a repository exception
24,824
static InstallException create ( RepositoryException e , Collection < String > featureNames , boolean installingAsset , RestRepositoryConnectionProxy proxy , boolean defaultRepo , boolean isOpenLiberty ) { Throwable cause = e ; Throwable rootCause = e ; while ( ( rootCause = cause . getCause ( ) ) != null && cause != rootCause ) { if ( rootCause instanceof UnknownHostException || rootCause instanceof FileNotFoundException || rootCause instanceof ConnectException ) { return create ( e , rootCause , proxy , defaultRepo ) ; } cause = rootCause ; } if ( featureNames != null ) { if ( isCertPathBuilderException ( cause ) ) return createByKey ( InstallException . CONNECTION_FAILED , e , defaultRepo ? "ERROR_FAILED_TO_CONNECT_CAUSED_BY_CERT" : "ERROR_FAILED_TO_CONNECT_REPOS_CAUSED_BY_CERT" ) ; String featuresListStr = InstallUtils . getFeatureListOutput ( featureNames ) ; InstallException ie ; if ( isOpenLiberty ) { ie = create ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( installingAsset ? "ERROR_FAILED_TO_RESOLVE_ASSETS" : "ERROR_FAILED_TO_RESOLVE_FEATURES_FOR_OPEN_LIBERTY" , featuresListStr ) , e ) ; } else { ie = create ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( installingAsset ? "ERROR_FAILED_TO_RESOLVE_ASSETS" : "ERROR_FAILED_TO_RESOLVE_FEATURES" , featuresListStr ) , e ) ; } ie . setData ( featuresListStr ) ; return ie ; } else return create ( e ) ; }
Create an install exception from a repository exception and feature names
24,825
static boolean isNewerVersion ( String version , String newestVersion , boolean isEarlyAccess ) { if ( version == null ) return false ; String [ ] versionAry = version . split ( "\\." ) ; if ( ! ! ! isEarlyAccess && versionAry [ 0 ] . length ( ) == 4 ) return false ; if ( isEarlyAccess && versionAry [ 0 ] . length ( ) != 4 ) return false ; if ( newestVersion == null ) return true ; String [ ] newestVersionAry = newestVersion . split ( "\\." ) ; for ( int i = 0 ; i < versionAry . length ; i ++ ) { if ( Integer . parseInt ( versionAry [ i ] ) > Integer . parseInt ( newestVersionAry [ i ] ) ) return true ; else if ( Integer . parseInt ( versionAry [ i ] ) < Integer . parseInt ( newestVersionAry [ i ] ) ) return false ; } return false ; }
Checks if the inputed version is newer than the newest version
24,826
@ SuppressWarnings ( "rawtypes" ) static String validateProductMatches ( String feature , List productMatchers , File installDir , boolean installingAsset ) { return validateProductMatches ( feature , null , productMatchers , installDir , installingAsset ) ; }
Calls validate product matches with null dependency
24,827
private static InstallException create ( String msg , Exception e , int rc ) { InstallException ie = new InstallException ( msg , e , rc ) ; return ie ; }
Creates an install exception from a message an existing exception and a return code
24,828
static String stacktraceToString ( Exception e ) { StringWriter sw = new StringWriter ( ) ; e . printStackTrace ( new PrintWriter ( sw ) ) ; String stackTrace = sw . toString ( ) ; return stackTrace ; }
Extracts StackTrace from exception and translates it to a string
24,829
public HttpCookie getCookie ( String name ) { if ( null == name || 0 == this . parsedList . size ( ) ) { return null ; } for ( HttpCookie cookie : this . parsedList ) { if ( cookie . getName ( ) . equals ( name ) ) { return cookie ; } } return null ; }
Search the cache for an existing Cookie that matches the input name .
24,830
public int getAllCookies ( String name , List < HttpCookie > list ) { int added = 0 ; if ( 0 < this . parsedList . size ( ) && null != name ) { for ( HttpCookie cookie : this . parsedList ) { if ( cookie . getName ( ) . equals ( name ) ) { list . add ( cookie . clone ( ) ) ; added ++ ; } } } return added ; }
Find all instances of cookies in the cache with the given name and add clones of those objects to the input list .
24,831
public int getAllCookies ( List < HttpCookie > list ) { int added = 0 ; if ( 0 < this . parsedList . size ( ) ) { for ( HttpCookie cookie : this . parsedList ) { list . add ( cookie . clone ( ) ) ; added ++ ; } } return added ; }
Clones all of the cookies in the cache onto the input list .
24,832
public int getAllCookieValues ( String name , List < String > list ) { int added = 0 ; if ( 0 < this . parsedList . size ( ) && null != name ) { for ( HttpCookie cookie : this . parsedList ) { if ( name . equals ( cookie . getName ( ) ) ) { list . add ( cookie . getValue ( ) ) ; } } } return added ; }
Find all instances of the input cookie name in the cache and append their values into the input list .
24,833
public CookieCacheData duplicate ( ) { CookieCacheData cData = new CookieCacheData ( ) ; cData . parsedList = copyList ( this . parsedList ) ; cData . isDirty = this . isDirty ; cData . hdrIndex = this . hdrIndex ; cData . headerType = this . headerType ; return cData ; }
Create a cloned independent representation of this object .
24,834
private static void showErrorMsg ( boolean showError , String msgKey , Object [ ] objs ) { if ( showError ) { String msg = Tr . formatMessage ( TraceSpecification . getTc ( ) , msgKey , objs ) ; BaseTraceService . rawSystemErr . println ( msg ) ; } }
Show the error message if showError is true
24,835
protected List < File > getClassFiles ( File root , File parent ) { if ( root == null || ! root . isDirectory ( ) ) { return null ; } List < File > fileList = new ArrayList < File > ( ) ; File [ ] files = root . listFiles ( ) ; for ( int i = 0 ; files != null && i < files . length ; i ++ ) { if ( files [ i ] . isDirectory ( ) ) { List < File > subdirFiles = getClassFiles ( files [ i ] , parent ) ; if ( subdirFiles != null ) { fileList . addAll ( subdirFiles ) ; } } else if ( files [ i ] . getName ( ) . endsWith ( ".class" ) ) { fileList . add ( files [ i ] ) ; } } return fileList ; }
Recursively search the specified directory for class files .
24,836
protected void addPackageInfo ( PackageInfo packageInfo ) { if ( packageInfo != null ) { packageInfoMap . put ( packageInfo . getInternalPackageName ( ) , packageInfo ) ; } }
Add package configuration information .
24,837
public void executeInstrumentation ( ) throws IOException { errors . clear ( ) ; for ( File f : this . classFiles ) { try { if ( ! f . canRead ( ) || ! f . canWrite ( ) ) { throw new IOException ( f + " can not be replaced" ) ; } instrumentClassFile ( f ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; errors . add ( e ) ; } } for ( File f : this . jarFiles ) { try { instrumentZipFile ( f ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; errors . add ( e ) ; } } if ( ! errors . isEmpty ( ) ) { Throwable t = errors . get ( 0 ) ; IOException ioe = new IOException ( errors . size ( ) + " errors occurred" ) ; ioe . initCause ( t ) ; throw ioe ; } }
Instrument the classes and jar files .
24,838
protected InputStream getClassInputStream ( String classInternalName ) { if ( classInternalName == null || "" . equals ( classInternalName ) ) { return null ; } InputStream inputStream = null ; try { for ( File jarFile : jarFiles ) { ZipFile zipFile = new ZipFile ( jarFile ) ; ZipEntry zipEntry = zipFile . getEntry ( classInternalName + ".class" ) ; if ( zipEntry != null ) { InputStream zis = zipFile . getInputStream ( zipEntry ) ; byte [ ] bytecode = toByteArray ( zis ) ; if ( isStreamForClass ( new ByteArrayInputStream ( bytecode ) , classInternalName ) ) { inputStream = new ByteArrayInputStream ( bytecode ) ; } zis . close ( ) ; } zipFile . close ( ) ; if ( inputStream != null ) { return inputStream ; } } String fileName = classInternalName + ".class" ; fileName = fileName . substring ( fileName . lastIndexOf ( '/' ) + 1 ) ; for ( File classFile : classFiles ) { if ( classFile . getName ( ) . equals ( fileName ) ) { FileInputStream fis = new FileInputStream ( classFile ) ; byte [ ] bytecode = toByteArray ( fis ) ; if ( isStreamForClass ( new ByteArrayInputStream ( bytecode ) , classInternalName ) ) { inputStream = new ByteArrayInputStream ( bytecode ) ; } fis . close ( ) ; } if ( inputStream != null ) { return inputStream ; } } } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } return null ; }
Get an InputStream containing the byte code for the specified class .
24,839
public void instrumentClassFile ( File classfile ) throws IOException { FileInputStream fis = new FileInputStream ( classfile ) ; byte [ ] bytes = transform ( fis ) ; fis . close ( ) ; fis = null ; if ( bytes != null ) { FileOutputStream fos = new FileOutputStream ( classfile ) ; fos . write ( bytes ) ; fos . close ( ) ; } }
Instrument the specified class file .
24,840
public void processPackageInfo ( ) throws IOException { for ( File classFile : classFiles ) { if ( classFile . getName ( ) . equals ( "package-info.class" ) ) { FileInputStream fis = new FileInputStream ( classFile ) ; addPackageInfo ( processPackageInfo ( fis ) ) ; fis . close ( ) ; } } for ( File jarFile : jarFiles ) { ZipFile zipFile = new ZipFile ( jarFile ) ; Enumeration < ? extends ZipEntry > zipEntries = zipFile . entries ( ) ; while ( zipEntries . hasMoreElements ( ) ) { ZipEntry zipEntry = zipEntries . nextElement ( ) ; if ( zipEntry . getName ( ) . endsWith ( "/package-info.class" ) ) { InputStream zis = zipFile . getInputStream ( zipEntry ) ; addPackageInfo ( processPackageInfo ( zis ) ) ; } } zipFile . close ( ) ; } }
Process the package level annotations that exist in the filesets .
24,841
protected PackageInfo processPackageInfo ( InputStream packageInfoResource ) { if ( packageInfoResource == null ) return null ; PackageInfo packageInfo = null ; try { ClassReader cr = new ClassReader ( packageInfoResource ) ; TraceConfigPackageVisitor packageVisitor = new TraceConfigPackageVisitor ( ) ; cr . accept ( packageVisitor , ClassReader . SKIP_CODE | ClassReader . SKIP_DEBUG | ClassReader . SKIP_FRAMES ) ; packageInfo = packageVisitor . getPackageInfo ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } return packageInfo ; }
Process the package level annotation data for trace instrumentation .
24,842
static void unbox ( GeneratorAdapter mg , Type type ) { switch ( type . getSort ( ) ) { case Type . VOID : return ; case Type . BOOLEAN : mg . visitTypeInsn ( CHECKCAST , "java/lang/Boolean" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Boolean" , "booleanValue" , "()Z" ) ; break ; case Type . CHAR : mg . visitTypeInsn ( CHECKCAST , "java/lang/Character" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Character" , "charValue" , "()C" ) ; break ; case Type . BYTE : mg . visitTypeInsn ( CHECKCAST , "java/lang/Byte" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Byte" , "byteValue" , "()B" ) ; break ; case Type . SHORT : mg . visitTypeInsn ( CHECKCAST , "java/lang/Short" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Short" , "shortValue" , "()S" ) ; break ; case Type . INT : mg . visitTypeInsn ( CHECKCAST , "java/lang/Integer" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Integer" , "intValue" , "()I" ) ; break ; case Type . FLOAT : mg . visitTypeInsn ( CHECKCAST , "java/lang/Float" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Float" , "floatValue" , "()F" ) ; break ; case Type . LONG : mg . visitTypeInsn ( CHECKCAST , "java/lang/Long" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Long" , "longValue" , "()J" ) ; break ; case Type . DOUBLE : mg . visitTypeInsn ( CHECKCAST , "java/lang/Double" ) ; mg . visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Double" , "doubleValue" , "()D" ) ; break ; default : mg . checkCast ( type ) ; break ; } }
d369262 . 7
24,843
public static String getClassConstantFieldName ( Class < ? > klass ) { String dollarName = klass . getName ( ) . replace ( '.' , '$' ) ; if ( dollarName . startsWith ( "[" ) ) { if ( dollarName . endsWith ( ";" ) ) { dollarName = dollarName . substring ( 0 , dollarName . length ( ) - 1 ) ; } return "array" + dollarName . replace ( '[' , '$' ) ; } return "class$" + dollarName ; }
Returns the synthetic field name for a Class constant .
24,844
public void validate ( ) { String target = getTargetName ( ) ; if ( delay ( ) < 0 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "circuitBreaker.parameter.delay.invalid.value.CWMFT5012E" , "delay" , delay ( ) , target ) ) ; } if ( ( failureRatio ( ) < 0 ) || ( failureRatio ( ) > 1 ) ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "circuitBreaker.parameter.failureRatio.invalid.value.CWMFT5013E" , "failureRatio" , failureRatio ( ) , target ) ) ; } if ( requestVolumeThreshold ( ) < 1 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "circuitBreaker.parameter.requestVolumeThreshold.invalid.value.CWMFT5014E" , "requestVolumeThreshold" , requestVolumeThreshold ( ) , target ) ) ; } if ( successThreshold ( ) < 1 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "circuitBreaker.parameter.successThreshold.invalid.value.CWMFT5015E" , "successThreshold" , successThreshold ( ) , target ) ) ; } if ( failOn ( ) . length == 0 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "circuitBreaker.parameter.failOn.invalid.value.CWMFT5018E" , "failOn" , target ) ) ; } }
Validate the CircuitBreaker policy
24,845
public Principal getCallerPrincipal ( boolean useRealm , String realm , boolean web , boolean isJaspiEnabled ) { Subject subject = subjectManager . getCallerSubject ( ) ; if ( subject == null ) { return null ; } SubjectHelper subjectHelper = new SubjectHelper ( ) ; if ( subjectHelper . isUnauthenticated ( subject ) && web ) { return null ; } if ( isJaspiEnabled ) { Principal principal = getPrincipalFromWSCredential ( subjectHelper , subject ) ; if ( principal != null ) { return principal ; } } String securityName = getSecurityNameFromWSCredential ( subjectHelper , subject ) ; if ( securityName == null ) { return null ; } Principal jsonWebToken = MpJwtHelper . getJsonWebTokenPricipal ( subject ) ; if ( jsonWebToken != null ) { return jsonWebToken ; } Set < WSPrincipal > principals = subject . getPrincipals ( WSPrincipal . class ) ; if ( principals . size ( ) > 1 ) { multiplePrincipalsError ( principals ) ; } WSPrincipal wsPrincipal = null ; if ( ! principals . isEmpty ( ) ) { String principalName = createPrincipalName ( useRealm , realm , securityName ) ; wsPrincipal = principals . iterator ( ) . next ( ) ; wsPrincipal = new WSPrincipal ( principalName , wsPrincipal . getAccessId ( ) , wsPrincipal . getAuthenticationMethod ( ) ) ; } return wsPrincipal ; }
Returns a java . security . Principal object containing the name of the current authenticated user . If the user has not been authenticated the method returns null . Look at the Subject on the thread only . We will extract security name from WSCredential and the set of Principals our WSPrincipal type . If a property has been set then the realm is prepended to the security name .
24,846
public final SIDestinationAddress createSIDestinationAddress ( String destinationName , boolean localOnly ) throws NullPointerException { if ( destinationName == null ) { throw new NullPointerException ( "destinationName" ) ; } return new JsDestinationAddressImpl ( destinationName , localOnly , null , null , false ) ; }
Create a new SIDestinationAddress to represent an SIBus Destination .
24,847
public final JsDestinationAddress createJsDestinationAddress ( String destinationName , boolean localOnly , SIBUuid8 meId ) throws NullPointerException { if ( destinationName == null ) { throw new NullPointerException ( "destinationName" ) ; } return new JsDestinationAddressImpl ( destinationName , localOnly , meId , null , false ) ; }
Create a JsDestinationAddress from the given parameters
24,848
public List < MetaTypeInformationSpecification > getMetatypeInformation ( ) { try { for ( Map . Entry < String , List < File > > prodEntry : prodJars . entrySet ( ) ) { List < File > jars = prodEntry . getValue ( ) ; String productName = prodEntry . getKey ( ) ; for ( File jar : jars ) { JarFile jarFile = new JarFile ( jar ) ; Enumeration < JarEntry > entries = jarFile . entries ( ) ; List < String > metatypePath = new ArrayList < String > ( ) ; HashMap < String , URL > metatypePropMap = new HashMap < String , URL > ( ) ; while ( entries . hasMoreElements ( ) ) { JarEntry entry = entries . nextElement ( ) ; String entryName = entry . getName ( ) ; if ( entry . isDirectory ( ) ) continue ; if ( entryName . endsWith ( XML_EXT ) && entryName . startsWith ( METATYPE_PAT ) ) { metatypePath . add ( entryName ) ; } if ( entryName . endsWith ( PROP_EXT ) ) { metatypePropMap . put ( entryName , new URL ( "jar:" + jar . toURI ( ) + "!/" + entryName ) ) ; } } boolean generateNewMetatype = true ; for ( String metatype : metatypePath ) { JarEntry metatypeEntry = jarFile . getJarEntry ( metatype ) ; InputStream metatypeInputStream = jarFile . getInputStream ( metatypeEntry ) ; parse ( metatypeInputStream , jarFile , generateNewMetatype , metatypePropMap , productName ) ; generateNewMetatype = false ; } } } } catch ( IOException ioe ) { throw new RuntimeException ( ioe ) ; } catch ( XMLStreamException xse ) { throw new RuntimeException ( xse ) ; } return metatypeList ; }
Since we don t have have the luxury of OSGi framework getting the OCDs for us we need to look up all the metatype . xml files from each jar manually and construct a metatypeinformation which will be passed to SchemaWriter
24,849
private URL generateMetatypePropertiesName ( String metatypeName , String locale ) { String lookupName ; if ( locale != null && locale . length ( ) > 0 ) { lookupName = metatypeName + LOCALE_SEPARATOR + locale + PROP_EXT ; } else { lookupName = metatypeName + PROP_EXT ; } URL url = bundle . getEntry ( lookupName ) ; if ( url == null ) { int pos = locale == null ? - 1 : locale . lastIndexOf ( LOCALE_SEPARATOR ) ; if ( pos != - 1 ) { url = generateMetatypePropertiesName ( metatypeName , locale . substring ( 0 , pos ) ) ; } } return url ; }
Tries to generate the correct metatype properties location according to locale
24,850
public synchronized ProxyQueueConversationGroup create ( Conversation conversation ) throws IllegalArgumentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "create" , conversation ) ; if ( convToGroupMap . containsKey ( conversation ) ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "PQGROUP_ALREADY_CREATED_SICO1054" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".create" , CommsConstants . PQCONVGRPFACTIMPL_CREATE_01 , this ) ; throw e ; } ProxyQueueConversationGroup group = new ProxyQueueConversationGroupImpl ( conversation , this ) ; convToGroupMap . put ( conversation , group ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "create" , group ) ; return group ; }
Creates a proxy queue conversation group .
24,851
protected synchronized void groupCloseNotification ( Conversation conversation , ProxyQueueConversationGroup group ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "groupCloseNotification" , new Object [ ] { conversation , group } ) ; if ( convToGroupMap . remove ( conversation ) == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "group unknown!" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "groupCloseNotification" ) ; }
Called by a proxy queue conversation group to notify this factory of its closure .
24,852
public static String exceptionList ( Throwable ex ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<=================================>" ) ; sb . append ( "Exception Message -> " ) ; sb . append ( ex . getMessage ( ) ) ; sb . append ( nl ) ; if ( ex instanceof ResourceException ) { sb . append ( " ResourceException Error Code -> " ) ; sb . append ( ( ( ResourceException ) ex ) . getErrorCode ( ) ) ; sb . append ( nl ) ; } if ( ex instanceof SQLException ) { sb . append ( " SQLException Error Code -> " ) ; sb . append ( ( ( SQLException ) ex ) . getErrorCode ( ) ) ; sb . append ( nl ) ; sb . append ( " SQLException SQLState -> " ) ; sb . append ( ( ( SQLException ) ex ) . getSQLState ( ) ) ; sb . append ( nl ) ; } StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; ex . printStackTrace ( pw ) ; sb . append ( sw . getBuffer ( ) ) ; sb . append ( "<=================================>" ) ; Throwable ex2 = null ; ex2 = ex . getCause ( ) ; if ( ex2 != null ) { sb . append ( "Next Linked Exception:" + nl ) ; sb . append ( exceptionList ( ex2 ) ) ; } return sb . toString ( ) ; }
Method which prints the stack trace of exception and any linked exceptions .
24,853
public static final String getNLSMessage ( String key , Object ... args ) { return NLS . getFormattedMessage ( key , args , key ) ; }
Retrieve a translated message from the J2C messages file . If the message cannot be found the key is returned .
24,854
static String stackTraceToString ( Throwable th ) { StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; for ( int depth = 0 ; depth < 10 && th != null ; depth ++ ) { th . printStackTrace ( pw ) ; Throwable cause = th . getCause ( ) ; if ( cause != th ) { th = cause ; pw . append ( "-------- chained exception -------" ) . append ( nl ) ; } } return sw . toString ( ) ; }
Formats an exception s stack trace as a String .
24,855
public byte [ ] toBytes ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "toBytes" ) ; final int gtridLength = ( _gtrid == null ? 0 : _gtrid . length ) ; final int bqualLength = ( _bqual == null ? 0 : _bqual . length ) ; final int nbytes = 12 + gtridLength + bqualLength ; final byte [ ] result = new byte [ nbytes ] ; Util . setBytesFromInt ( result , 0 , 4 , _formatId ) ; Util . setBytesFromInt ( result , 4 , 4 , gtridLength ) ; Util . setBytesFromInt ( result , 8 , 4 , bqualLength ) ; if ( gtridLength > 0 ) System . arraycopy ( _gtrid , 0 , result , 12 , gtridLength ) ; if ( bqualLength > 0 ) System . arraycopy ( _bqual , 0 , result , 12 + gtridLength , bqualLength ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "toBytes" , Util . toHexString ( result ) ) ; return result ; }
Build a native Xid form suitable for recreating with the mainline constructor as in the XA specification .
24,856
public byte [ ] getOtidBytes ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getOtidBytes" ) ; if ( _otid == null ) { final int total_length = _gtrid . length + _bqual . length ; _otid = new byte [ total_length ] ; System . arraycopy ( _gtrid , 0 , _otid , 0 , _gtrid . length ) ; System . arraycopy ( _bqual , 0 , _otid , _gtrid . length , _bqual . length ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getOtidBytes" , _otid ) ; return Util . duplicateByteArray ( _otid ) ; }
Gets the otid . tid style raw byte representation of this XidImpl .
24,857
protected void setStoken ( byte [ ] stoken ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setStoken" , stoken ) ; if ( stoken != null ) System . arraycopy ( stoken , 0 , _bqual , BQUAL_STOKEN_OFFSET , BQUAL_STOKEN_LENGTH ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setStoken" ) ; }
Set the stoken associated with this Xid .
24,858
public static boolean isOurFormatId ( int formatIdentifier ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isOurFormatId" , formatIdentifier ) ; final boolean result ; switch ( formatIdentifier ) { case ZOS_FID_CB390 : case ZOS_FID_CBLT : case WAS_FID_WASD : result = true ; break ; case WAS_FID_WASC : case WAS_FID_WASZ : case ZOS_FID_WASZ : default : result = false ; break ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isOurFormatId" , Boolean . valueOf ( result ) ) ; return result ; }
Checks to see if this formatId is one of our generated formatIds . This is a first pass check on recovery to filter XIDs from RMs . We do not need to validate platform as the next phase check is for UUID which will be different for each application server .
24,859
void getSingletonNames ( Set < String > singletons ) { for ( Map . Entry < String , ConfigurationList < SimpleElement > > entry : configurationMap . entrySet ( ) ) { ConfigurationList < SimpleElement > list = entry . getValue ( ) ; if ( ! list . isEmpty ( ) && ! list . hasId ( ) ) { singletons . add ( entry . getKey ( ) ) ; } } }
guarantees here so this should really go away .
24,860
public Map < ConfigID , FactoryElement > getFactoryInstancesUsingDefaultId ( String pid , String alias , String defaultId ) throws ConfigMergeException { Map < ConfigID , List < SimpleElement > > defaultFactories = defaultConfigurationFactories ( pid , alias , defaultId ) ; Map < ConfigID , List < SimpleElement > > factories = getAllFactoryElements ( pid , alias , defaultId ) ; Map < ConfigID , FactoryElement > mergedMap = new HashMap < ConfigID , FactoryElement > ( ) ; for ( Map . Entry < ConfigID , List < SimpleElement > > entry : factories . entrySet ( ) ) { ConfigID elementId = entry . getKey ( ) ; List < SimpleElement > defaultElements = defaultFactories . remove ( elementId ) ; if ( defaultElements == null ) { FactoryElement merged = new FactoryElement ( entry . getValue ( ) , pid , elementId . getId ( ) ) ; mergedMap . put ( elementId , merged ) ; } else { Iterator < SimpleElement > iter = defaultElements . iterator ( ) ; while ( iter . hasNext ( ) ) { SimpleElement element = iter . next ( ) ; if ( element . mergeBehavior == MergeBehavior . MERGE_WHEN_MISSING ) { iter . remove ( ) ; } } if ( ! defaultElements . isEmpty ( ) ) { FactoryElement merged = new FactoryElement ( defaultElements , pid , elementId . getId ( ) ) ; merged . attributes . remove ( XMLConfigConstants . CFG_INSTANCE_ID ) ; merged . merge ( entry . getValue ( ) ) ; mergedMap . put ( elementId , merged ) ; } else { FactoryElement merged = new FactoryElement ( entry . getValue ( ) , pid , elementId . getId ( ) ) ; mergedMap . put ( elementId , merged ) ; } } } for ( Map . Entry < ConfigID , List < SimpleElement > > entry : defaultFactories . entrySet ( ) ) { ConfigID elementId = entry . getKey ( ) ; List < SimpleElement > elements = entry . getValue ( ) ; boolean found = false ; for ( SimpleElement element : elements ) { if ( element . mergeBehavior != MergeBehavior . MERGE_WHEN_EXISTS ) found = true ; } if ( found ) { FactoryElement merged = new FactoryElement ( elements , pid , elementId . getId ( ) ) ; mergedMap . put ( elementId , merged ) ; } } return mergedMap ; }
Get a Map of FactoryElements indexed by ConfigID
24,861
public String getAuthorizationEndpoint ( SocialLoginConfig clientConfig ) throws SocialLoginException { final String authzEndpoint = clientConfig . getAuthorizationEndpoint ( ) ; SocialUtil . validateEndpointWithQuery ( authzEndpoint ) ; return authzEndpoint ; }
Gets and validates the authorization endpoint URL from the provided social login configuration .
24,862
public String createStateCookie ( HttpServletRequest request , HttpServletResponse response ) { String stateValue = SocialUtil . generateRandom ( ) ; String loginHint = socialWebUtils . getLoginHint ( request ) ; if ( ! request . getMethod ( ) . equalsIgnoreCase ( "GET" ) && loginHint != null ) { stateValue = stateValue + loginHint ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Setting cookie " + ClientConstants . COOKIE_NAME_STATE_KEY + " to " + stateValue ) ; } Cookie stateCookie = referrerURLCookieHandler . createCookie ( ClientConstants . COOKIE_NAME_STATE_KEY , stateValue , request ) ; response . addCookie ( stateCookie ) ; return stateValue ; }
Generates a random state value adds a cookie to the response with that value and returns the value .
24,863
@ SuppressWarnings ( "unchecked" ) public final List < String > getAudienceAsList ( ) { if ( audience == null ) { return Collections . emptyList ( ) ; } if ( audience instanceof String ) { return Collections . singletonList ( ( String ) audience ) ; } return ( List < String > ) audience ; }
Returns the list of audience claim that identifies the audience that the JWT is intended for or empty for none .
24,864
public static final Object getImpl ( Object obj ) { InvocationHandler handler ; return Proxy . isProxyClass ( obj . getClass ( ) ) && ( handler = Proxy . getInvocationHandler ( obj ) ) instanceof WSJdbcTracer ? ( ( WSJdbcTracer ) handler ) . impl : obj ; }
Returns the underlying object .
24,865
protected synchronized void modified ( Map < String , Object > cfwConfiguration ) { if ( null == cfwConfiguration ) { return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Processing config" , cfwConfiguration ) ; } this . chfw . updateConfig ( cfwConfiguration ) ; }
Modified method . This method is called when the service properties associated with the service are updated through a configuration change .
24,866
public void serverStopping ( ) { long timeout = chfw . getDefaultChainQuiesceTimeout ( ) ; if ( timeout > 0 ) { ChainData [ ] runningChains = chfw . getRunningChains ( ) ; List < String > names = new ArrayList < String > ( ) ; for ( int i = 0 ; i < runningChains . length ; i ++ ) { if ( FlowType . INBOUND . equals ( runningChains [ i ] . getType ( ) ) ) { names . add ( runningChains [ i ] . getName ( ) ) ; } } ChannelUtils . stopChains ( names , - 1 , null ) ; } }
When notified that the server is going to stop pre - quiesce all chains in the runtime . This will be called before services start getting torn down ..
24,867
@ Reference ( service = EventEngine . class , cardinality = ReferenceCardinality . MANDATORY ) protected void setEventService ( EventEngine service ) { this . eventService = service ; }
DS method for setting the event reference .
24,868
public static ScheduledEventService getScheduleService ( ) { CHFWBundle c = instance . get ( ) . get ( ) ; if ( null != c ) { return c . scheduler ; } return null ; }
Access the scheduled event service .
24,869
@ Reference ( service = ScheduledExecutorService . class , cardinality = ReferenceCardinality . MANDATORY ) protected void setScheduledExecutorService ( ScheduledExecutorService ref ) { this . scheduledExecutor = ref ; }
DS method for setting the scheduled executor service reference .
24,870
public static ScheduledExecutorService getScheduledExecutorService ( ) { CHFWBundle c = instance . get ( ) . get ( ) ; if ( null != c ) { return c . scheduledExecutor ; } return null ; }
Access the scheduled executor service .
24,871
@ Reference ( service = ScheduledEventService . class , cardinality = ReferenceCardinality . MANDATORY ) protected void setScheduledEventService ( ScheduledEventService ref ) { this . scheduler = ref ; }
DS method for setting the scheduled event service reference .
24,872
@ Reference ( service = ChannelFactoryProvider . class , cardinality = ReferenceCardinality . MULTIPLE , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) protected void setFactoryProvider ( ChannelFactoryProvider provider ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Add factory provider; " + provider ) ; } this . chfw . registerFactories ( provider ) ; }
DS method to set a factory provider .
24,873
protected void unsetFactoryProvider ( ChannelFactoryProvider provider ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Remove factory provider; " + provider ) ; } this . chfw . deregisterFactories ( provider ) ; }
DS method to remove a factory provider .
24,874
protected void threadBegin ( ) { try { tranMgr . setTransactionTimeout ( 0 ) ; if ( beforeCallbacks != null ) { for ( IJobExecutionStartCallbackService callback : beforeCallbacks ) { if ( logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASSNAME , "threadBegin" , "Calling before callback" , callback ) ; } callback . jobStarted ( runtimeWorkUnitExecution ) ; } } } catch ( Throwable t ) { runtimeWorkUnitExecution . logExecutionFailedMessage ( ) ; throw new BatchContainerRuntimeException ( "An error occurred during thread initialization." , t ) ; } }
All the beginning of thread processing .
24,875
protected void threadEnd ( ) { try { getBatchKernel ( ) . workUnitCompleted ( this ) ; } catch ( Exception e ) { } if ( afterCallbacks != null ) { for ( IJobExecutionEndCallbackService callback : afterCallbacks ) { try { if ( logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASSNAME , "threadEnd" , "Calling after callback" , callback ) ; } callback . jobEnded ( runtimeWorkUnitExecution ) ; } catch ( Throwable t ) { } } } try { tranMgr . setTransactionTimeout ( 0 ) ; } catch ( SystemException e ) { } }
All the end of thread processing .
24,876
public void initializeTimeout ( TimeoutElement elt ) { if ( elt == null ) { elt = new TimeoutElement ( beanId , getSessionTimeoutInMilliSeconds ( ) ) ; } ivTimeoutElement = elt ; }
F61004 . 5
24,877
public void setInterceptors ( Object [ ] interceptors ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . debug ( tc , "setInterceptors interceptors = " + interceptors + ", for SFSB: " + this ) ; } ivInterceptors = interceptors ; }
d367572 . 7 - added entire method .
24,878
protected void completeRemoveMethod ( ContainerTx tx ) throws RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "completeRemoveMethod: " + this ) ; long pmiCookie = 0 ; if ( pmiBean != null ) { pmiCookie = pmiBean . initialTime ( EJBPMICollaborator . REMOVE_RT ) ; } EJBThreadData threadData = EJSContainer . getThreadData ( ) ; threadData . pushContexts ( this ) ; try { remove ( ) ; } catch ( RemoveException rex ) { throw ExceptionUtil . EJBException ( "Remove Failed" , rex ) ; } finally { if ( tx != null ) { tx . ivRemoveBeanO = null ; } threadData . popContexts ( ) ; if ( pmiBean != null ) { pmiBean . finalTime ( EJBPMICollaborator . REMOVE_RT , pmiCookie ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "completeRemoveMethod" ) ; } }
Completes the removal of the bean after a Remove method has been called .
24,879
private boolean isLifecycleCallbackGlobalTx ( int methodId ) { EJBMethodInfoImpl [ ] methodInfos = home . beanMetaData . lifecycleInterceptorMethodInfos ; return methodInfos != null && methodInfos [ methodId ] . getTransactionAttribute ( ) == TransactionAttribute . TX_REQUIRES_NEW ; }
Returns true if the specific lifecycle callback should run with a global transaction .
24,880
protected void beginLifecycleCallback ( int methodId , CallbackContextHelper contextHelper , CallbackContextHelper . Contexts pushContexts ) throws CSIException { CallbackContextHelper . Tx beginTx = isLifecycleCallbackGlobalTx ( methodId ) ? CallbackContextHelper . Tx . Global : CallbackContextHelper . Tx . CompatLTC ; contextHelper . begin ( beginTx , pushContexts ) ; }
Begin contexts for a lifecycle callback .
24,881
private boolean isRollbackOnlyAllowed ( ) { switch ( state ) { case PRE_CREATE : case AFTER_COMPLETION : return false ; case CREATING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_POST_CONSTRUCT ) ; case ACTIVATING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_PASSIVATE ) ; case PASSIVATING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_PASSIVATE ) ; case REMOVING : return isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_DESTROY ) ; case DESTROYED : return destroying && isLifecycleCallbackGlobalTx ( LifecycleInterceptorWrapper . MID_PRE_DESTROY ) ; } return true ; }
Returns true if rollback only methods can be called in the current state .
24,882
public void setRollbackOnly ( ) { synchronized ( this ) { if ( ! isRollbackOnlyAllowed ( ) ) { IllegalStateException ise ; ise = new IllegalStateException ( "StatefulBean: setRollbackOnly() " + "not allowed from state = " + getStateName ( state ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setRollbackOnly: " + ise ) ; throw ise ; } } super . setRollbackOnly ( ) ; }
setRollbackOnly - It is illegal to call this method during ejbCreate ejbActivate ejbPassivate ejbRemove and also if the method being invoked has one of notsupported supports or never as its transaction attribute
24,883
public void updateFailoverEntry ( byte [ ] beanData , long lastAccessTime ) throws RemoteException { try { ivSfFailoverClient . passivated ( beanId , beanData , lastAccessTime ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".updateFailoverEntry" , "1137" , this ) ; throw new RemoteException ( "Could not update SFSB Entry" , e ) ; } }
Update failover entry for this SFSB with the replicated data for this SFSB and indicate SFSB status is passivated .
24,884
public void updateFailoverSetActiveProp ( ) { try { if ( ivSfFailoverClient != null ) { ivSfFailoverClient . activated ( beanId , ivTimeoutElement . lastAccessTime ) ; } } catch ( Throwable e ) { FFDCFilter . processException ( e , CLASS_NAME + ".updateFailoverProp" , "1158" , this ) ; } }
Update the failover entry to indicate the SFSB is now active .
24,885
public void setJPAExPcBindingContext ( Object exPc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . debug ( tc , "setJPAExPcBindingContext: " + exPc ) ; ivExPcContext = exPc ; }
Set the JPAExPcBindingContext for this SFSB . Typically used by the StatefulPassivator class when it activates a previously passivated SFSB .
24,886
protected void afterDelivery ( final SIBusMessage message , MessageEndpoint endpoint , final boolean success ) throws ResourceException { final String methodName = "afterDelivery" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { message , Boolean . valueOf ( success ) } ) ; } super . afterDelivery ( message , endpoint , success ) ; if ( success && processMessage ( message ) ) { deleteMessage ( message , null ) ; } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
Invoked after delivery of a message . If the message delivery was successful deletes the message .
24,887
private void configureSecurity ( List < com . ibm . ws . javaee . dd . web . common . SecurityConstraint > securityConstraints , LoginConfig loginConfig , List < SecurityRole > securityRoles , List < ServletMapping > servletMappings , List < EnvEntry > envEntries , boolean denyUncoveredHttpMethods ) { processSecurityConstraints ( securityConstraints , denyUncoveredHttpMethods ) ; processLoginConfig ( loginConfig ) ; processSecurityRoles ( securityRoles ) ; processURLPatterns ( servletMappings ) ; processEnvEntries ( envEntries ) ; processDenyUncoveredHttpMethods ( denyUncoveredHttpMethods ) ; }
Configure the security metadata from the given information .
24,888
private void processSecurityRoles ( WebAnnotations webAnnotations , Set < String > classesWithSecurityRoles , Class < ? extends Annotation > securityAnnotation , boolean annotationForClass ) throws UnableToAdaptException { for ( String classWithSecurityRole : classesWithSecurityRoles ) { ClassInfo classInfo = webAnnotations . getClassInfo ( classWithSecurityRole ) ; final String fullyQualifiedClassName = classWithSecurityRole ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "@" + securityAnnotation . getSimpleName ( ) + " found on class " , fullyQualifiedClassName ) ; } AnnotationInfo rolesAnnotation = null ; if ( annotationForClass ) { rolesAnnotation = classInfo . getAnnotation ( securityAnnotation ) ; getRoleValues ( rolesAnnotation ) ; } else { for ( MethodInfo methodInfo : classInfo . getDeclaredMethods ( ) ) { rolesAnnotation = methodInfo . getAnnotation ( securityAnnotation ) ; getRoleValues ( rolesAnnotation ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "allRoles: " + allRoles ) ; } }
Create a list of roles that represent the security annotation
24,889
private void processEnvEntries ( List < EnvEntry > envEntries ) { if ( envEntries != null ) { for ( EnvEntry envEntry : envEntries ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processing envEntry" , envEntry . getName ( ) , envEntry . getValue ( ) ) ; } if ( SYNC_TO_OS_THREAD_ENV_ENTRY_KEY . equals ( envEntry . getName ( ) ) ) { syncToOSThread = Boolean . parseBoolean ( envEntry . getValue ( ) ) ; } } } }
Process the env - entry s from the application s deployment descriptor .
24,890
private void processSecurityRoleRefs ( String servletName , List < SecurityRoleRef > servletSecurityRoleRefs ) { Map < String , String > securityRoleRefs = new HashMap < String , String > ( ) ; securityRoleRefsByServlet . put ( servletName , securityRoleRefs ) ; for ( SecurityRoleRef secRoleRef : servletSecurityRoleRefs ) { if ( secRoleRef . getLink ( ) == null ) { Tr . warning ( tc , "MISSING_SEC_ROLE_REF_ROLE_LINK" , new Object [ ] { servletName , secRoleRef . getName ( ) } ) ; } else if ( allRoles . contains ( secRoleRef . getLink ( ) ) ) { securityRoleRefs . put ( secRoleRef . getName ( ) , secRoleRef . getLink ( ) ) ; } else { Tr . warning ( tc , "INVALID_SEC_ROLE_REF_ROLE_LINK" , new Object [ ] { servletName , secRoleRef . getLink ( ) , secRoleRef . getName ( ) } ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "securityRoleRefsByServlet: " + securityRoleRefsByServlet ) ; } }
Creates a map of security - role - ref elements to servlet name .
24,891
private SecurityConstraint createSecurityConstraint ( com . ibm . ws . javaee . dd . web . common . SecurityConstraint archiveConstraint , boolean denyUncoveredHttpMethods ) { List < WebResourceCollection > webResourceCollections = createWebResourceCollections ( archiveConstraint , denyUncoveredHttpMethods ) ; List < String > roles = createRoles ( archiveConstraint ) ; boolean sslRequired = isSSLRequired ( archiveConstraint ) ; boolean accessPrecluded = isAccessPrecluded ( archiveConstraint ) ; boolean fromHttpConstraint = false ; boolean accessUncovered = false ; return new SecurityConstraint ( webResourceCollections , roles , sslRequired , accessPrecluded , fromHttpConstraint , accessUncovered ) ; }
Creates a SecurityConstraint object that represents a security - constraint element in web . xml .
24,892
private boolean isSSLRequired ( com . ibm . ws . javaee . dd . web . common . SecurityConstraint archiveConstraint ) { boolean sslRequired = false ; UserDataConstraint dataConstraint = archiveConstraint . getUserDataConstraint ( ) ; if ( dataConstraint != null ) { int transportGuarantee = dataConstraint . getTransportGuarantee ( ) ; String webResourceName = archiveConstraint . getWebResourceCollections ( ) . get ( 0 ) . getWebResourceName ( ) ; Map < String , ConfigItem < String > > userDataConstraintMap = configurator . getConfigItemMap ( USER_DATA_CONSTRAINT_KEY ) ; ConfigItem < String > existingUserDataConstraint = userDataConstraintMap . get ( webResourceName ) ; if ( existingUserDataConstraint == null ) { userDataConstraintMap . put ( webResourceName , this . configurator . createConfigItem ( String . valueOf ( transportGuarantee ) ) ) ; if ( transportGuarantee != UserDataConstraint . TRANSPORT_GUARANTEE_NONE ) { sslRequired = true ; } } else { this . configurator . validateDuplicateConfiguration ( SECURITY_CONSTRAINT_KEY , USER_DATA_CONSTRAINT_KEY , String . valueOf ( transportGuarantee ) , existingUserDataConstraint ) ; if ( ConfigSource . WEB_FRAGMENT == this . configurator . getConfigSource ( ) && ConfigSource . WEB_XML == existingUserDataConstraint . getSource ( ) ) { return false ; } } } return sslRequired ; }
Determines if SSL is required . SSL is required if the transport guarantee is other than NONE . Note that only one user - data - constraint element can be present per security - constraint . Only the first occurrence is processed . If multiple web fragments specify this element with different values and it s absent from the web . xml this will result in an error that fails the application install .
24,893
public static String getLogicalModuleName ( String path ) { int lastForwardSlash = path . lastIndexOf ( '/' ) ; if ( lastForwardSlash != - 1 ) { path = path . substring ( lastForwardSlash + 1 ) ; } int lastDot = path . lastIndexOf ( '.' ) ; if ( lastDot != - 1 ) { path = path . substring ( 0 , lastDot ) ; } return path ; }
Parses the logical module name from a module path . The module path is a relative path name using forward slashes . The logical module name is the base name of the module name with the suffix removed .
24,894
private String getNameSpaceID ( Context javaColonContext ) { String nsID = null ; String context = javaColonContext != null ? javaColonContext . toString ( ) : null ; if ( context != null ) { nsID = "UNKNOWN" ; int idx = context . indexOf ( "_nameSpaceID=" ) ; if ( idx != - 1 ) { nsID = context . substring ( idx + 13 ) ; idx = nsID . indexOf ( ',' ) ; if ( idx != - 1 ) { nsID = nsID . substring ( 0 , idx ) ; } } } return nsID ; }
F46994 . 3
24,895
private Message getMessageFromProxy ( Message msg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMessageFromProxy" , msg ) ; try { if ( msg instanceof Proxy ) { InvocationHandler handler = Proxy . getInvocationHandler ( msg ) ; if ( handler instanceof MessageProxyInvocationHandler ) { msg = ( ( MessageProxyInvocationHandler ) handler ) . getMessage ( ) ; } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Exception in getMessageFromProxy .. returning msg as it is" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMessageFromProxy" , msg ) ; return msg ; }
returns the actual message implementation object if msg is Proxy ... this method ignores any message is owned by other than SIB .
24,896
private void sendUsingConnection ( Destination destination , Message message , int deliveryMode , int priority , long timeToLive ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendUsingConnection" , new Object [ ] { destination , message , deliveryMode , priority , timeToLive } ) ; checkClosed ( ) ; session . checkSynchronousUsage ( "send" ) ; if ( message == null ) { throw ( MessageFormatException ) JmsErrorUtils . newThrowable ( MessageFormatException . class , "INVALID_VALUE_CWSIA0068" , new Object [ ] { "message" , null } , tc ) ; } JmsDestinationImpl nativeDest = validateDestination ( destination ) ; ProducerProperties pp = new ProducerProperties ( nativeDest , this , session . getPassThruProps ( ) , null , null ) ; pp . setInDeliveryMode ( deliveryMode ) ; pp . setInPriority ( priority ) ; pp . setInTTL ( timeToLive ) ; sendMessage ( pp , message , nativeDest ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendUsingConnection" ) ; }
This method is internal method which would send message to ME on top of connection . This is called from Sync send and Async Send . In case of Sync send it would have guarded with monitor sessionSyncLock .
24,897
private JmsDestinationImpl validateDestination ( Destination destination ) throws JMSException { if ( this . dest != null ) { if ( destination == null ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "INVALID_VALUE_CWSIA0281" , new Object [ ] { "Destination" , null } , tc ) ; } throw ( UnsupportedOperationException ) JmsErrorUtils . newThrowable ( UnsupportedOperationException . class , "DEST_SPECIFIED_ON_SEND_CWSIA0066" , null , tc ) ; } JmsDestinationImpl nativeDest = JmsDestinationImpl . checkNativeInstance ( destination ) ; if ( this . dest == null ) { JmsDestinationImpl . checkBlockedStatus ( nativeDest ) ; } return nativeDest ; }
This method validates destination and returns native destination if validation is proper
24,898
private void validateDeliveryMode ( int deliveryMode ) throws JMSException { switch ( deliveryMode ) { case DeliveryMode . NON_PERSISTENT : case DeliveryMode . PERSISTENT : break ; default : throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INVALID_VALUE_CWSIA0068" , new Object [ ] { "JMSDeliveryMode" , "" + deliveryMode } , tc ) ; } }
Validates the deliveryMode property throwing an exception if there is a problem .
24,899
private void validatePriority ( int x ) throws JMSException { if ( ( x < 0 ) || ( x > 9 ) ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INVALID_VALUE_CWSIA0068" , new Object [ ] { "JMSPriority" , "" + x } , tc ) ; } }
This method carries out validation on the priority field .