signature:
public class CSIv2Util { /** * Return a top - level { @ code IOP : : TaggedComponent } to be stuffed into an IOR , containing a structure
 * { @ code SSLIOP : : SSL } , tagged as { @ code TAG _ SSL _ SEC _ TRANS } .
 * Should be called with non - null metadata , in which case we probably don ' t want to include security info in the IOR .
 * @ param metadata the metadata object that contains the SSL configuration info .
 * @ param codec the { @ code Codec } used to encode the SSL component .
 * @ param sslPort an { @ code int } representing the SSL port .
 * @ param orb a reference to the running { @ code ORB } .
 * @ return a { @ code TaggedComponent } representing the encoded SSL component . */
public static TaggedComponent createSSLTaggedComponent ( IORSecurityConfigMetaData metadata , Codec codec , int sslPort , ORB orb ) { } }

implementation:
if ( metadata == null ) { IIOPLogger . ROOT_LOGGER . debug ( "Method createSSLTaggedComponent() called with null metadata" ) ; return null ; } if ( sslPort == 0 ) { // no support for transport security .
return null ; } TaggedComponent tc ; try { int supports = createTargetSupports ( metadata . getTransportConfig ( ) ) ; int requires = createTargetRequires ( metadata . getTransportConfig ( ) ) ; SSL ssl = new SSL ( ( short ) supports , ( short ) requires , ( short ) sslPort ) ; Any any = orb . create_any ( ) ; SSLHelper . insert ( any , ssl ) ; byte [ ] componentData = codec . encode_value ( any ) ; tc = new TaggedComponent ( TAG_SSL_SEC_TRANS . value , componentData ) ; } catch ( InvalidTypeForEncoding e ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( e ) ; } return tc ;


signature:
public class CSIv2Util { /** * Return a top - level { @ code IOP : TaggedComponent } to be stuffed into an IOR , containing a { @ code org . omg . CSIIOP } .
 * { @ code CompoundSecMechList } , tagged as { @ code TAG _ CSI _ SEC _ MECH _ LIST } . Only one such component can exist inside
 * an IOR .
 * Should be called with non - null metadata , in which case we probably don ' t want to include security info in the IOR .
 * @ param metadata the metadata object that contains the CSIv2 security configuration info .
 * @ param codec the { @ code Codec } used to encode the CSIv2 security component .
 * @ param sslPort an { @ code int } representing the SSL port .
 * @ param orb a reference to the running { @ code ORB } .
 * @ return a { @ code TaggedComponent } representing the encoded CSIv2 security component . */
public static TaggedComponent createSecurityTaggedComponent ( IORSecurityConfigMetaData metadata , Codec codec , int sslPort , ORB orb ) { } }

implementation:
if ( metadata == null ) { IIOPLogger . ROOT_LOGGER . debug ( "Method createSecurityTaggedComponent() called with null metadata" ) ; return null ; } TaggedComponent tc ; // get the the supported security mechanisms .
CompoundSecMech [ ] mechList = createCompoundSecMechanisms ( metadata , codec , sslPort , orb ) ; // the above is wrapped into a org . omg . CSIIOP . CompoundSecMechList structure , which is NOT a CompoundSecMech [ ] .
// we don ' t support stateful / reusable security contexts ( false ) .
CompoundSecMechList csmList = new CompoundSecMechList ( false , mechList ) ; // finally , the CompoundSecMechList must be encoded as a TaggedComponent
try { Any any = orb . create_any ( ) ; CompoundSecMechListHelper . insert ( any , csmList ) ; byte [ ] b = codec . encode_value ( any ) ; tc = new TaggedComponent ( TAG_CSI_SEC_MECH_LIST . value , b ) ; } catch ( InvalidTypeForEncoding e ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( e ) ; } return tc ;


signature:
public class CSIv2Util { /** * Create a { @ code org . omg . CSIIOP . CompoundSecMechanisms } which is a sequence of { @ code CompoundSecMech } . Here we only
 * support one security mechanism .
 * @ param metadata the metadata object that contains the CSIv2 security configuration info .
 * @ param codec the { @ code Codec } used to encode the CSIv2 security component .
 * @ param sslPort an { @ code int } representing the SSL port .
 * @ param orb a reference to the running { @ code ORB } .
 * @ return the constructed { @ code CompoundSecMech } array . */
public static CompoundSecMech [ ] createCompoundSecMechanisms ( IORSecurityConfigMetaData metadata , Codec codec , int sslPort , ORB orb ) { } }

implementation:
// support just 1 security mechanism for now ( and ever ) .
CompoundSecMech [ ] csmList = new CompoundSecMech [ 1 ] ; // a CompoundSecMech contains : target _ requires , transport _ mech , as _ context _ mech , sas _ context _ mech .
TaggedComponent transport_mech = createTransportMech ( metadata . getTransportConfig ( ) , codec , sslPort , orb ) ; // create AS Context .
AS_ContextSec asContext = createAuthenticationServiceContext ( metadata ) ; // create SAS Context .
SAS_ContextSec sasContext = createSecureAttributeServiceContext ( metadata ) ; // create target _ requires bit field ( AssociationOption ) can ' t read directly the transport _ mech TaggedComponent .
int target_requires = createTargetRequires ( metadata . getTransportConfig ( ) ) | asContext . target_requires | sasContext . target_requires ; CompoundSecMech csm = new CompoundSecMech ( ( short ) target_requires , transport_mech , asContext , sasContext ) ; csmList [ 0 ] = csm ; return csmList ;


signature:
public class CSIv2Util { /** * Create the Secure Attribute Service ( SAS ) context included in a { @ code CompoundSecMech } definition .
 * @ param metadata the metadata object that contains the CSIv2 security configuration info .
 * @ return the constructed { @ code SAS _ ContextSec } instance . */
public static SAS_ContextSec createSecureAttributeServiceContext ( IORSecurityConfigMetaData metadata ) { } }

implementation:
SAS_ContextSec context ; // context contains target _ supports , target _ requires , privilige _ authorities , supported _ naming _ mechanisms , supported _ identity _ types .
int support = 0 ; int require = 0 ; ServiceConfiguration [ ] privilAuth = new ServiceConfiguration [ 0 ] ; byte [ ] [ ] supNamMechs = { } ; int supIdenTypes = 0 ; // 0 means ITTAbsent
// the the SasContext metadata .
IORSASContextMetaData sasMeta = metadata . getSasContext ( ) ; // if no SAS context metadata , or caller propagation is not supported , we return with a more or less empty sas context .
if ( sasMeta == null || sasMeta . getCallerPropagation ( ) . equals ( IORSASContextMetaData . CALLER_PROPAGATION_NONE ) ) { context = new SAS_ContextSec ( ( short ) support , ( short ) require , privilAuth , supNamMechs , supIdenTypes ) ; } else { support = IdentityAssertion . value ; // supporting GSSUP ( username / password ) naming mechanism .
byte [ ] upMech = createGSSUPMechOID ( ) ; supNamMechs = new byte [ 1 ] [ upMech . length ] ; System . arraycopy ( upMech , 0 , supNamMechs [ 0 ] , 0 , upMech . length ) ; // since we support IdentityAssertion we need to specify supported identity types . CTS says we need them all
supIdenTypes = ITTAnonymous . value | ITTPrincipalName . value | ITTX509CertChain . value | ITTDistinguishedName . value ; context = new SAS_ContextSec ( ( short ) support , ( short ) require , privilAuth , supNamMechs , supIdenTypes ) ; } return context ;


signature:
public class CSIv2Util { /** * Create the client Authentication Service ( AS ) context included in a { @ code CompoundSecMech } definition .
 * @ param metadata the metadata object that contains the CSIv2 security configuration info .
 * @ return the constructed { @ code AS _ ContextSec } instance . */
public static AS_ContextSec createAuthenticationServiceContext ( IORSecurityConfigMetaData metadata ) { } }

implementation:
AS_ContextSec context ; // the content of the context .
int support = 0 ; int require = 0 ; byte [ ] clientAuthMech = { } ; byte [ ] targetName = { } ; IORASContextMetaData asMeta = metadata . getAsContext ( ) ; // if no AS context metatada exists , or authentication method " none " is specified , we can produce an empty AS context .
if ( asMeta == null || asMeta . getAuthMethod ( ) . equals ( IORASContextMetaData . AUTH_METHOD_NONE ) ) { context = new AS_ContextSec ( ( short ) support , ( short ) require , clientAuthMech , targetName ) ; } else { // we do support .
support = EstablishTrustInClient . value ; // required depends on the metadata .
if ( asMeta . isRequired ( ) ) { require = EstablishTrustInClient . value ; } // we only support GSSUP authentication method .
clientAuthMech = createGSSUPMechOID ( ) ; // finally , encode the " realm " name as a CSI . GSS _ NT _ ExportedName .
// clientAuthMech should contain the DER encoded GSSUPMechOID at this point .
String realm = asMeta . getRealm ( ) ; targetName = createGSSExportedName ( clientAuthMech , realm . getBytes ( StandardCharsets . UTF_8 ) ) ; context = new AS_ContextSec ( ( short ) support , ( short ) require , clientAuthMech , targetName ) ; } return context ;


signature:
public class CSIv2Util { /** * Create a transport mechanism { @ code TaggedComponent } to be stuffed into a { @ code CompoundSecMech } .
 * If no { @ code TransportConfig } metadata is specified , or ssl port is negative , or the specified metadata indicates
 * that transport config is not supported , then a { @ code TAG _ NULL _ TAG } ( empty ) { @ code TaggedComponent } will be returned .
 * Otherwise a { @ code org . omg . CSIIOP . TLS _ SEC _ TRANS } , tagged as { @ code TAG _ TLS _ SEC _ TRANS } will be returned , indicating support
 * for TLS / SSL as a CSIv2 transport mechanism .
 * Multiple { @ code TransportAddress } may be included in the SSL info ( host / port pairs ) , but we only include one .
 * @ param tconfig the transport configuration metadata .
 * @ param codec the { @ code Codec } used to encode the transport configuration .
 * @ param sslPort an { @ code int } representing the SSL port .
 * @ param orb a reference to the running { @ code ORB } .
 * @ return the constructed { @ code TaggedComponent } . */
public static TaggedComponent createTransportMech ( IORTransportConfigMetaData tconfig , Codec codec , int sslPort , ORB orb ) { } }

implementation:
TaggedComponent tc ; // what we support and require as a target .
int support = 0 ; int require = 0 ; if ( tconfig != null ) { require = createTargetRequires ( tconfig ) ; support = createTargetSupports ( tconfig ) ; } if ( tconfig == null || support == 0 || sslPort == 0 ) { // no support for transport security .
tc = new TaggedComponent ( TAG_NULL_TAG . value , new byte [ 0 ] ) ; } else { // my ip address .
String host = CorbaORBService . getORBProperty ( Constants . ORB_ADDRESS ) ; // this will create only one transport address .
TransportAddress [ ] taList = createTransportAddress ( host , sslPort ) ; TLS_SEC_TRANS tst = new TLS_SEC_TRANS ( ( short ) support , ( short ) require , taList ) ; // The tricky part , we must encode TLS _ SEC _ TRANS into an octet sequence .
try { Any any = orb . create_any ( ) ; TLS_SEC_TRANSHelper . insert ( any , tst ) ; byte [ ] b = codec . encode_value ( any ) ; tc = new TaggedComponent ( TAG_TLS_SEC_TRANS . value , b ) ; } catch ( InvalidTypeForEncoding e ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( e ) ; } } return tc ;


signature:
public class CSIv2Util { /** * Create a { @ code TransportAddress [ ] } with a single { @ code TransportAddress } .
 * @ param host a { @ code String } representing the address host .
 * @ param port an { @ code int } representing the address port .
 * @ return the constructed { @ code TransportAddress } array . */
public static TransportAddress [ ] createTransportAddress ( String host , int port ) { } }

implementation:
// idl type is unsigned sort , so we need this trick
short short_port = ( port > 32767 ) ? ( short ) ( port - 65536 ) : ( short ) port ; TransportAddress ta = new TransportAddress ( host , short_port ) ; TransportAddress [ ] taList = new TransportAddress [ 1 ] ; taList [ 0 ] = ta ; return taList ;


signature:
public class CSIv2Util { /** * Create the bitmask of what the target requires .
 * @ param tc the transport configuration metadata .
 * @ return an { @ code int } representing the transport mechanism required by the target . */
public static int createTargetRequires ( IORTransportConfigMetaData tc ) { } }

implementation:
int requires = 0 ; if ( tc != null ) { if ( tc . getIntegrity ( ) . equals ( IORTransportConfigMetaData . INTEGRITY_REQUIRED ) ) { requires = requires | Integrity . value ; } if ( tc . getConfidentiality ( ) . equals ( IORTransportConfigMetaData . CONFIDENTIALITY_REQUIRED ) ) { requires = requires | Confidentiality . value ; } if ( tc . getDetectMisordering ( ) . equalsIgnoreCase ( IORTransportConfigMetaData . DETECT_MISORDERING_REQUIRED ) ) { requires = requires | DetectMisordering . value ; } if ( tc . getDetectReplay ( ) . equalsIgnoreCase ( IORTransportConfigMetaData . DETECT_REPLAY_REQUIRED ) ) { requires = requires | DetectReplay . value ; } // no EstablishTrustInTarget required - client decides
if ( tc . getEstablishTrustInClient ( ) . equals ( IORTransportConfigMetaData . ESTABLISH_TRUST_IN_CLIENT_REQUIRED ) ) { requires = requires | EstablishTrustInClient . value ; } } return requires ;


signature:
public class CSIv2Util { /** * Create the bitmask of what the target supports .
 * @ param tc the transport configuration metadata .
 * @ return an { @ code int } representing the transport mechanisms supported by the target . */
public static int createTargetSupports ( IORTransportConfigMetaData tc ) { } }

implementation: int supports = 0 ; if ( tc != null ) { if ( ! tc . getIntegrity ( ) . equals ( IORTransportConfigMetaData . INTEGRITY_NONE ) ) { supports = supports | Integrity . value ; } if ( ! tc . getConfidentiality ( ) . equals ( IORTransportConfigMetaData . CONFIDENTIALITY_NONE ) ) { supports = supports | Confidentiality . value ; } if ( ! tc . getDetectMisordering ( ) . equalsIgnoreCase ( IORTransportConfigMetaData . DETECT_MISORDERING_NONE ) ) { supports = supports | DetectMisordering . value ; } if ( ! tc . getDetectReplay ( ) . equalsIgnoreCase ( IORTransportConfigMetaData . DETECT_REPLAY_NONE ) ) { supports = supports | DetectReplay . value ; } if ( ! tc . getEstablishTrustInTarget ( ) . equals ( IORTransportConfigMetaData . ESTABLISH_TRUST_IN_TARGET_NONE ) ) { supports = supports | EstablishTrustInTarget . value ; } if ( ! tc . getEstablishTrustInClient ( ) . equals ( IORTransportConfigMetaData . ESTABLISH_TRUST_IN_CLIENT_NONE ) ) { supports = supports | EstablishTrustInClient . value ; } } return supports ;


signature:
public class CSIv2Util { /** * Create an ASN . 1 , DER encoded representation for the GSSUP OID mechanism .
 * @ return the DER encoded representation of the GSSUP OID . */
public static byte [ ] createGSSUPMechOID ( ) { } }

implementation:
// kudos to org . ietf . jgss . Oid for the Oid utility need to strip the " oid : " part of the GSSUPMechOID first .
byte [ ] retval = { } ; try { Oid oid = new Oid ( GSSUPMechOID . value . substring ( 4 ) ) ; retval = oid . getDER ( ) ; } catch ( GSSException e ) { IIOPLogger . ROOT_LOGGER . caughtExceptionEncodingGSSUPMechOID ( e ) ; } return retval ;


signature:
public class CSIv2Util { /** * Generate an exported name as specified in [ RFC 2743 ] , section 3.2 copied below :
 * 3.2 : Mechanism - Independent Exported Name Object Format
 * This section specifies a mechanism - independent level of encapsulating representation for names exported via the
 * GSS _ Export _ name ( ) call , including an object identifier representing the exporting mechanism . The format of names
 * encapsulated via this representation shall be defined within individual mechanism drafts . The Object Identifier
 * value to indicate names of this type is defined in Section 4.7 of this document .
 * No name type OID is included in this mechanism - independent level of format definition , since ( depending on
 * individual mechanism specifications ) the enclosed name may be implicitly typed or may be explicitly typed using
 * a means other than OID encoding .
 * The bytes within MECH _ OID _ LEN and NAME _ LEN elements are represented most significant byte first ( equivalently ,
 * in IP network byte order ) .
 * Length Name Description
 * 2 TOK _ ID Token Identifier
 * For exported name objects , this must be hex 04 01.
 * 2 MECH _ OID _ LEN Length of the Mechanism OID
 * MECH _ OID _ LEN MECH _ OID Mechanism OID , in DER
 * 4 NAME _ LEN Length of name
 * NAME _ LEN NAME Exported name ; format defined in applicable mechanism draft .
 * A concrete example of the contents of an exported name object , derived from the Kerberos Version 5 mechanism , is
 * as follows :
 * 04 01 00 0B 06 09 2A 86 48 86 F7 12 01 02 02 hx xx xx xl pp qq . . . zz
 * @ param oid the DER encoded OID .
 * @ param name the name to be converted to { @ code GSSExportedName } .
 * @ return a { @ code byte [ ] } representing the exported name . */
public static byte [ ] createGSSExportedName ( byte [ ] oid , byte [ ] name ) { } }

implementation:
int olen = oid . length ; int nlen = name . length ; // size according to spec .
int size = 2 + 2 + olen + 4 + nlen ; // allocate space for the exported name .
byte [ ] buf = new byte [ size ] ; // index .
int i = 0 ; // standard header .
buf [ i ++ ] = 0x04 ; buf [ i ++ ] = 0x01 ; // encode oid length .
buf [ i ++ ] = ( byte ) ( olen & 0xFF00 ) ; buf [ i ++ ] = ( byte ) ( olen & 0x00FF ) ; // copy the oid in the exported name buffer .
System . arraycopy ( oid , 0 , buf , i , olen ) ; i += olen ; // encode the name length in the exported buffer .
buf [ i ++ ] = ( byte ) ( nlen & 0xFF000000 ) ; buf [ i ++ ] = ( byte ) ( nlen & 0x00FF0000 ) ; buf [ i ++ ] = ( byte ) ( nlen & 0x0000FF00 ) ; buf [ i ++ ] = ( byte ) ( nlen & 0x000000FF ) ; // finally , copy the name bytes .
System . arraycopy ( name , 0 , buf , i , nlen ) ; return buf ;


signature:
public class CSIv2Util { /** * ASN . 1 - encode an { @ code InitialContextToken } as defined in RFC 2743 , Section 3.1 , " Mechanism - Independent Token
 * Format " , pp . 81-82 . The encoded token contains the ASN . 1 tag 0x60 , followed by a token length ( which is itself
 * stored in a variable - length format and takes 1 to 5 bytes ) , the GSSUP mechanism identifier , and a mechanism - specific
 * token , which in this case is a CDR encapsulation of the GSSUP { @ code InitialContextToken } in the { @ code authToken }
 * parameter .
 * @ param authToken the { @ code InitialContextToken } to be encoded .
 * @ param codec the { @ code Codec } used to encode the token .
 * @ return a { @ code byte [ ] } representing the encoded token . */
public static byte [ ] encodeInitialContextToken ( InitialContextToken authToken , Codec codec ) { } }

implementation:
byte [ ] out ; Any any = ORB . init ( ) . create_any ( ) ; InitialContextTokenHelper . insert ( any , authToken ) ; try { out = codec . encode_value ( any ) ; } catch ( Exception e ) { return new byte [ 0 ] ; } int length = out . length + gssUpMechOidArray . length ; int n ; if ( length < ( 1 << 7 ) ) { n = 0 ; } else if ( length < ( 1 << 8 ) ) { n = 1 ; } else if ( length < ( 1 << 16 ) ) { n = 2 ; } else if ( length < ( 1 << 24 ) ) { n = 3 ; } else { // if ( length < ( 1 < < 32 ) )
n = 4 ; } byte [ ] encodedToken = new byte [ 2 + n + length ] ; encodedToken [ 0 ] = 0x60 ; if ( n == 0 ) { encodedToken [ 1 ] = ( byte ) length ; } else { encodedToken [ 1 ] = ( byte ) ( n | 0x80 ) ; switch ( n ) { case 1 : encodedToken [ 2 ] = ( byte ) length ; break ; case 2 : encodedToken [ 2 ] = ( byte ) ( length >> 8 ) ; encodedToken [ 3 ] = ( byte ) length ; break ; case 3 : encodedToken [ 2 ] = ( byte ) ( length >> 16 ) ; encodedToken [ 3 ] = ( byte ) ( length >> 8 ) ; encodedToken [ 4 ] = ( byte ) length ; break ; default : // case 4:
encodedToken [ 2 ] = ( byte ) ( length >> 24 ) ; encodedToken [ 3 ] = ( byte ) ( length >> 16 ) ; encodedToken [ 4 ] = ( byte ) ( length >> 8 ) ; encodedToken [ 5 ] = ( byte ) length ; } } System . arraycopy ( gssUpMechOidArray , 0 , encodedToken , 2 + n , gssUpMechOidArray . length ) ; System . arraycopy ( out , 0 , encodedToken , 2 + n + gssUpMechOidArray . length , out . length ) ; return encodedToken ;


signature:
public class CSIv2Util { /** * Decodes an ASN . 1 - encoded { @ code InitialContextToken } . See { @ code encodeInitialContextToken } for a description of
 * the encoded token format .
 * @ param encodedToken the encoded token .
 * @ param codec the { @ code Codec } used to decode the token .
 * @ return the decoded { @ code InitialContextToken } instance .
 * @ see # encodeInitialContextToken ( org . omg . GSSUP . InitialContextToken , org . omg . IOP . Codec ) */
public static InitialContextToken decodeInitialContextToken ( byte [ ] encodedToken , Codec codec ) { } }

implementation: if ( encodedToken [ 0 ] != 0x60 ) return null ; int encodedLength = 0 ; int n = 0 ; if ( encodedToken [ 1 ] >= 0 ) encodedLength = encodedToken [ 1 ] ; else { n = encodedToken [ 1 ] & 0x7F ; for ( int i = 1 ; i <= n ; i ++ ) { encodedLength += ( encodedToken [ 1 + i ] & 0xFF ) << ( n - i ) * 8 ; } } int length = encodedLength - gssUpMechOidArray . length ; byte [ ] encodedInitialContextToken = new byte [ length ] ; System . arraycopy ( encodedToken , 2 + n + gssUpMechOidArray . length , encodedInitialContextToken , 0 , length ) ; Any any ; try { any = codec . decode_value ( encodedInitialContextToken , InitialContextTokenHelper . type ( ) ) ; } catch ( Exception e ) { return null ; } return InitialContextTokenHelper . extract ( any ) ;


signature:
public class CSIv2Util { /** * Decodes a GSS exported name that has been encoded with the GSSUP mechanism OID . See { @ code createGSSExportedName }
 * for a description of the encoding format .
 * @ param encodedName the encoded exported name .
 * @ return a { @ code byte [ ] } representing the decoded exported name .
 * @ see # createGSSExportedName ( byte [ ] , byte [ ] ) */
public static byte [ ] decodeGssExportedName ( byte [ ] encodedName ) { } }

implementation:
if ( encodedName [ 0 ] != 0x04 || encodedName [ 1 ] != 0x01 ) return null ; int mechOidLength = ( encodedName [ 2 ] & 0xFF ) << 8 ; // MECH _ OID _ LEN
mechOidLength += ( encodedName [ 3 ] & 0xFF ) ; // MECH _ OID _ LEN
byte [ ] oidArray = new byte [ mechOidLength ] ; System . arraycopy ( encodedName , 4 , oidArray , 0 , mechOidLength ) ; for ( int i = 0 ; i < mechOidLength ; i ++ ) { if ( gssUpMechOidArray [ i ] != oidArray [ i ] ) { return null ; } } int offset = 4 + mechOidLength ; int nameLength = ( encodedName [ offset ] & 0xFF ) << 24 ; nameLength += ( encodedName [ ++ offset ] & 0xFF ) << 16 ; nameLength += ( encodedName [ ++ offset ] & 0xFF ) << 8 ; nameLength += ( encodedName [ ++ offset ] & 0xFF ) ; byte [ ] name = new byte [ nameLength ] ; System . arraycopy ( encodedName , ++ offset , name , 0 , nameLength ) ; return name ;


signature:
public class CSIv2Util { /** * Helper method to be called from a client request interceptor . The { @ code ri } parameter refers to the current
 * request . This method returns the first { @ code CompoundSecMech } found in the target IOR such that
 * < ul >
 * < li > all { @ code CompoundSecMech } requirements are satisfied by the options in the { @ code clientSupports }
 * parameter , and < / li >
 * < li > every requirement in the { @ code clientRequires } parameter is satisfied by the { @ code CompoundSecMech } .
 * < / li >
 * < / ul >
 * The method returns null if the target IOR contains no { @ code CompoundSecMech } s or if no matching
 * { @ code CompoundSecMech } is found .
 * Since this method is intended to be called from a client request interceptor , it converts unexpected exceptions
 * into { @ code MARSHAL } exceptions .
 * @ param ri a reference to the current { @ code ClientRequestInfo } .
 * @ param codec the { @ code Codec } used to decode the CSIv2 components .
 * @ param clientSupports the client supported transport options that must be satisfied by the { @ code CompoundSecMech } .
 * @ param clientRequires the client required transport options that must be satisfied by the { @ code CompoundSecMech } .
 * @ return the { @ code CompoundSecMech } instance that satisfies all client options , or { @ code null } if no such object
 * can be found . */
public static CompoundSecMech getMatchingSecurityMech ( ClientRequestInfo ri , Codec codec , short clientSupports , short clientRequires ) { } }

implementation:
CompoundSecMechList csmList ; try { TaggedComponent tc = ri . get_effective_component ( org . omg . IOP . TAG_CSI_SEC_MECH_LIST . value ) ; Any any = codec . decode_value ( tc . component_data , CompoundSecMechListHelper . type ( ) ) ; csmList = CompoundSecMechListHelper . extract ( any ) ; // look for the first matching security mech .
for ( int i = 0 ; i < csmList . mechanism_list . length ; i ++ ) { CompoundSecMech securityMech = csmList . mechanism_list [ i ] ; AS_ContextSec authConfig = securityMech . as_context_mech ; if ( ( EstablishTrustInTarget . value & ( clientRequires ^ authConfig . target_supports ) & ~ authConfig . target_supports ) != 0 ) { // client requires EstablishTrustInTarget , but target does not support it : skip this securityMech .
continue ; } if ( ( EstablishTrustInClient . value & ( authConfig . target_requires ^ clientSupports ) & ~ clientSupports ) != 0 ) { // target requires EstablishTrustInClient , but client does not support it : skip this securityMech .
continue ; } SAS_ContextSec identityConfig = securityMech . sas_context_mech ; if ( ( IdentityAssertion . value & ( identityConfig . target_requires ^ clientSupports ) & ~ clientSupports ) != 0 ) { // target requires IdentityAssertion , but client does not support it : skip this securityMech
continue ; } // found matching securityMech .
return securityMech ; } // no matching securityMech was found .
return null ; } catch ( BAD_PARAM e ) { // no component with TAG _ CSI _ SEC _ MECH _ LIST was found .
return null ; } catch ( org . omg . IOP . CodecPackage . TypeMismatch e ) { // unexpected exception in codec
throw IIOPLogger . ROOT_LOGGER . unexpectedException ( e ) ; } catch ( org . omg . IOP . CodecPackage . FormatMismatch e ) { // unexpected exception in codec
throw IIOPLogger . ROOT_LOGGER . unexpectedException ( e ) ; }


signature:
public class EESubsystemParser10 { /** * { @ inheritDoc } */
@ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } }

implementation:
// EE subsystem doesn ' t have any attributes , so make sure that the xml doesn ' t have any
requireNoAttributes ( reader ) ; final ModelNode eeSubSystem = Util . createAddOperation ( PathAddress . pathAddress ( EeExtension . PATH_SUBSYSTEM ) ) ; // add the subsystem to the ModelNode ( s )
list . add ( eeSubSystem ) ; // elements
final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { switch ( Namespace . forUri ( reader . getNamespaceURI ( ) ) ) { case EE_1_0 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( ! encountered . add ( element ) ) { throw unexpectedElement ( reader ) ; } switch ( element ) { case GLOBAL_MODULES : { final ModelNode model = parseGlobalModules ( reader ) ; eeSubSystem . get ( GlobalModulesDefinition . GLOBAL_MODULES ) . set ( model ) ; break ; } case EAR_SUBDEPLOYMENTS_ISOLATED : { final String earSubDeploymentsIsolated = parseEarSubDeploymentsIsolatedElement ( reader ) ; // set the ear subdeployment isolation on the subsystem operation
EeSubsystemRootResource . EAR_SUBDEPLOYMENTS_ISOLATED . parseAndSetParameter ( earSubDeploymentsIsolated , eeSubSystem , reader ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class EjbRefProcessor { /** * Resolves ejb - ref and ejb - local - ref elements
 * @ param deploymentUnit
 * @ param environment The environment to resolve the elements for
 * @ param componentDescription
 * @ param classLoader The deployment class loader
 * @ param deploymentReflectionIndex The reflection index
 * @ param applicationClasses @ return The bindings for the environment entries */
protected List < BindingConfiguration > processDescriptorEntries ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ResourceInjectionTarget resourceInjectionTarget , final ComponentDescription componentDescription , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , final EEApplicationClasses applicationClasses ) throws DeploymentUnitProcessingException { } }

implementation:
final RemoteEnvironment remoteEnvironment = environment . getEnvironment ( ) ; List < BindingConfiguration > bindingDescriptions = new ArrayList < BindingConfiguration > ( ) ; EJBReferencesMetaData ejbRefs = remoteEnvironment . getEjbReferences ( ) ; if ( ejbRefs != null ) { for ( EJBReferenceMetaData ejbRef : ejbRefs ) { String name = ejbRef . getEjbRefName ( ) ; String ejbName = ejbRef . getLink ( ) ; String lookup = ejbRef . getLookupName ( ) != null ? ejbRef . getLookupName ( ) : ejbRef . getMappedName ( ) ; String remoteInterface = ejbRef . getRemote ( ) ; String home = ejbRef . getHome ( ) ; Class < ? > remoteInterfaceType = null ; // if a home is specified this is the type that is bound
if ( ! isEmpty ( home ) ) { try { remoteInterfaceType = ClassLoadingUtils . loadClass ( home , deploymentUnit ) ; } catch ( ClassNotFoundException e ) { throw EjbLogger . ROOT_LOGGER . failedToLoadViewClass ( e , home ) ; } } else if ( ! isEmpty ( remoteInterface ) ) { try { remoteInterfaceType = ClassLoadingUtils . loadClass ( remoteInterface , deploymentUnit ) ; } catch ( ClassNotFoundException e ) { throw EjbLogger . ROOT_LOGGER . failedToLoadViewClass ( e , remoteInterface ) ; } } if ( ! name . startsWith ( "java:" ) ) { name = environment . getDefaultContext ( ) + name ; } // our injection ( source ) comes from the local ( ENC ) lookup , no matter what .
LookupInjectionSource injectionSource = new LookupInjectionSource ( name ) ; // add any injection targets
remoteInterfaceType = processInjectionTargets ( resourceInjectionTarget , injectionSource , classLoader , deploymentReflectionIndex , ejbRef , remoteInterfaceType ) ; final BindingConfiguration bindingConfiguration ; EjbInjectionSource ejbInjectionSource = null ; if ( ! isEmpty ( lookup ) ) { if ( ! lookup . startsWith ( "java:" ) ) { bindingConfiguration = new BindingConfiguration ( name , new EjbLookupInjectionSource ( lookup , remoteInterfaceType ) ) ; } else { bindingConfiguration = new BindingConfiguration ( name , new LookupInjectionSource ( lookup ) ) ; } } else { if ( remoteInterfaceType == null ) { throw EjbLogger . ROOT_LOGGER . couldNotDetermineEjbRefForInjectionTarget ( name , resourceInjectionTarget ) ; } if ( ! isEmpty ( ejbName ) ) { bindingConfiguration = new BindingConfiguration ( name , ejbInjectionSource = new EjbInjectionSource ( ejbName , remoteInterfaceType . getName ( ) , name , deploymentUnit , appclient ) ) ; } else { bindingConfiguration = new BindingConfiguration ( name , ejbInjectionSource = new EjbInjectionSource ( remoteInterfaceType . getName ( ) , name , deploymentUnit , appclient ) ) ; } } if ( ejbInjectionSource != null ) { deploymentUnit . addToAttachmentList ( EjbDeploymentAttachmentKeys . EJB_INJECTIONS , ejbInjectionSource ) ; } bindingDescriptions . add ( bindingConfiguration ) ; } } if ( remoteEnvironment instanceof Environment && ! appclient ) { EJBLocalReferencesMetaData ejbLocalRefs = ( ( Environment ) remoteEnvironment ) . getEjbLocalReferences ( ) ; if ( ejbLocalRefs != null ) { for ( EJBLocalReferenceMetaData ejbRef : ejbLocalRefs ) { String name = ejbRef . getEjbRefName ( ) ; String ejbName = ejbRef . getLink ( ) ; String lookup = ejbRef . getLookupName ( ) != null ? ejbRef . getLookupName ( ) : ejbRef . getMappedName ( ) ; String localInterface = ejbRef . getLocal ( ) ; String localHome = ejbRef . getLocalHome ( ) ; Class < ? > localInterfaceType = null ; // if a home is specified this is the type that is bound
if ( ! isEmpty ( localHome ) ) { try { localInterfaceType = ClassLoadingUtils . loadClass ( localHome , deploymentUnit ) ; } catch ( ClassNotFoundException e ) { throw EjbLogger . ROOT_LOGGER . failedToLoadViewClass ( e , localHome ) ; } } else if ( ! isEmpty ( localInterface ) ) { try { localInterfaceType = ClassLoadingUtils . loadClass ( localInterface , deploymentUnit ) ; } catch ( ClassNotFoundException e ) { throw EjbLogger . ROOT_LOGGER . failedToLoadViewClass ( e , localInterface ) ; } } if ( ! name . startsWith ( "java:" ) ) { name = environment . getDefaultContext ( ) + name ; } // our injection ( source ) comes from the local ( ENC ) lookup , no matter what .
LookupInjectionSource injectionSource = new LookupInjectionSource ( name ) ; // add any injection targets
localInterfaceType = processInjectionTargets ( resourceInjectionTarget , injectionSource , classLoader , deploymentReflectionIndex , ejbRef , localInterfaceType ) ; if ( localInterfaceType == null ) { throw EjbLogger . ROOT_LOGGER . couldNotDetermineEjbLocalRefForInjectionTarget ( name , resourceInjectionTarget ) ; } final BindingConfiguration bindingConfiguration ; EjbInjectionSource ejbInjectionSource = null ; if ( ! isEmpty ( lookup ) ) { if ( ! lookup . startsWith ( "java:" ) ) { bindingConfiguration = new BindingConfiguration ( name , new EjbLookupInjectionSource ( lookup , localInterfaceType ) ) ; } else { bindingConfiguration = new BindingConfiguration ( name , new LookupInjectionSource ( lookup ) ) ; } } else if ( ! isEmpty ( ejbName ) ) { bindingConfiguration = new BindingConfiguration ( name , ejbInjectionSource = new EjbInjectionSource ( ejbName , localInterfaceType . getName ( ) , name , deploymentUnit , appclient ) ) ; } else { bindingConfiguration = new BindingConfiguration ( name , ejbInjectionSource = new EjbInjectionSource ( localInterfaceType . getName ( ) , name , deploymentUnit , appclient ) ) ; } if ( ejbInjectionSource != null ) { deploymentUnit . addToAttachmentList ( EjbDeploymentAttachmentKeys . EJB_INJECTIONS , ejbInjectionSource ) ; } bindingDescriptions . add ( bindingConfiguration ) ; } } } return bindingDescriptions ;


signature:
public class AbstractDeploymentDescriptorBindingsProcessor { /** * Processes the injection targets of a resource binding
 * @ param injectionSource The injection source for the injection target
 * @ param classLoader The module class loader
 * @ param deploymentReflectionIndex The deployment reflection index
 * @ param entry The resource with injection targets
 * @ param classType The expected type of the injection point , may be null if this is to be inferred from the injection target
 * @ return The actual class type of the injection point
 * @ throws DeploymentUnitProcessingException
 * If the injection points could not be resolved */
protected Class < ? > processInjectionTargets ( final ResourceInjectionTarget resourceInjectionTarget , InjectionSource injectionSource , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , ResourceInjectionMetaData entry , Class < ? > classType ) throws DeploymentUnitProcessingException { } }

implementation: if ( entry . getInjectionTargets ( ) != null ) { for ( ResourceInjectionTargetMetaData injectionTarget : entry . getInjectionTargets ( ) ) { final String injectionTargetClassName = injectionTarget . getInjectionTargetClass ( ) ; final String injectionTargetName = injectionTarget . getInjectionTargetName ( ) ; final AccessibleObject fieldOrMethod = getInjectionTarget ( injectionTargetClassName , injectionTargetName , classLoader , deploymentReflectionIndex ) ; final Class < ? > injectionTargetType = fieldOrMethod instanceof Field ? ( ( Field ) fieldOrMethod ) . getType ( ) : ( ( Method ) fieldOrMethod ) . getParameterTypes ( ) [ 0 ] ; final String memberName = fieldOrMethod instanceof Field ? ( ( Field ) fieldOrMethod ) . getName ( ) : ( ( Method ) fieldOrMethod ) . getName ( ) ; if ( classType != null ) { if ( ! injectionTargetType . isAssignableFrom ( classType ) ) { boolean ok = false ; if ( classType . isPrimitive ( ) ) { if ( BOXED_TYPES . get ( classType ) . equals ( injectionTargetType ) ) { ok = true ; } } else if ( injectionTargetType . isPrimitive ( ) ) { if ( BOXED_TYPES . get ( injectionTargetType ) . equals ( classType ) ) { ok = true ; } } if ( ! ok ) { throw EeLogger . ROOT_LOGGER . invalidInjectionTarget ( injectionTarget . getInjectionTargetName ( ) , injectionTarget . getInjectionTargetClass ( ) , classType ) ; } classType = injectionTargetType ; } } else { classType = injectionTargetType ; } final InjectionTarget injectionTargetDescription = fieldOrMethod instanceof Field ? new FieldInjectionTarget ( injectionTargetClassName , memberName , classType . getName ( ) ) : new MethodInjectionTarget ( injectionTargetClassName , memberName , classType . getName ( ) ) ; final ResourceInjectionConfiguration injectionConfiguration = new ResourceInjectionConfiguration ( injectionTargetDescription , injectionSource ) ; resourceInjectionTarget . addResourceInjection ( injectionConfiguration ) ; } } return classType ;


signature:
public class WeldStartService { /** * Stops the container
 * Executed in WeldStartService to shutdown the runtime before NamingService is closed .
 * @ throws IllegalStateException if the container is not running */
@ Override public void stop ( final StopContext context ) { } }

implementation: final WeldBootstrapService bootstrapService = bootstrapSupplier . get ( ) ; if ( ! bootstrapService . isStarted ( ) ) { throw WeldLogger . ROOT_LOGGER . notStarted ( "WeldContainer" ) ; } WeldLogger . DEPLOYMENT_LOGGER . stoppingWeldService ( bootstrapService . getDeploymentName ( ) ) ; ClassLoader oldTccl = WildFlySecurityManager . getCurrentContextClassLoaderPrivileged ( ) ; try { WildFlySecurityManager . setCurrentContextClassLoaderPrivileged ( bootstrapService . getDeployment ( ) . getModule ( ) . getClassLoader ( ) ) ; WeldProvider . containerShutDown ( Container . instance ( bootstrapService . getDeploymentName ( ) ) ) ; bootstrapService . getBootstrap ( ) . shutdown ( ) ; } finally { WildFlySecurityManager . setCurrentContextClassLoaderPrivileged ( oldTccl ) ; ModuleGroupSingletonProvider . removeClassLoader ( bootstrapService . getDeployment ( ) . getModule ( ) . getClassLoader ( ) ) ; } bootstrapService . setStarted ( false ) ;


signature:
public class Util { /** * Extracts the raw JNDINAME value from the given model node , and depending on the value and
 * the value of any USE _ JAVA _ CONTEXT child node , converts the raw name into a compliant jndi name .
 * @ param modelNode the model node ; either an operation or the model behind a datasource resource
 * @ return the compliant jndi name */
public static String getJndiName ( final OperationContext context , final ModelNode modelNode ) throws OperationFailedException { } }

implementation: final String rawJndiName = JNDI_NAME . resolveModelAttribute ( context , modelNode ) . asString ( ) ; return cleanJndiName ( rawJndiName , modelNode . hasDefined ( USE_JAVA_CONTEXT . getName ( ) ) && modelNode . get ( USE_JAVA_CONTEXT . getName ( ) ) . asBoolean ( ) ) ;


signature:
public class MicroProfileConfigSubsystemAdd { /** * { @ inheritDoc } */
@ Override public void performBoottime ( OperationContext context , ModelNode operation , ModelNode model ) { } }

implementation: MicroProfileConfigLogger . ROOT_LOGGER . activatingSubsystem ( ) ; ConfigProviderService . install ( context ) ; context . addStep ( new AbstractDeploymentChainStep ( ) { public void execute ( DeploymentProcessorTarget processorTarget ) { processorTarget . addDeploymentProcessor ( MicroProfileConfigExtension . SUBSYSTEM_NAME , Phase . DEPENDENCIES , Phase . DEPENDENCIES_MICROPROFILE_CONFIG , new DependencyProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( MicroProfileConfigExtension . SUBSYSTEM_NAME , Phase . POST_MODULE , Phase . POST_MODULE_MICROPROFILE_CONFIG , new SubsystemDeploymentProcessor ( ) ) ; } } , OperationContext . Stage . RUNTIME ) ;


signature:
public class JMSBridgeAdd { /** * Return null if the resolved attribute is not defined */
private String resolveAttribute ( SimpleAttributeDefinition attr , OperationContext context , ModelNode model ) throws OperationFailedException { } }

implementation: final ModelNode node = attr . resolveModelAttribute ( context , model ) ; return node . isDefined ( ) ? node . asString ( ) : null ;


signature:
public class EjbJarParsingDeploymentUnitProcessor { /** * Finds an ejb - jar . xml ( at WEB - INF of a . war or META - INF of a . jar ) parses the file and creates
 * metadata out of it . The metadata is then attached to the deployment unit .
 * @ param deploymentPhase
 * @ throws DeploymentUnitProcessingException */
@ Override public void deploy ( DeploymentPhaseContext deploymentPhase ) throws DeploymentUnitProcessingException { } }

implementation:
// get hold of the deployment unit .
final DeploymentUnit deploymentUnit = deploymentPhase . getDeploymentUnit ( ) ; // get the root of the deployment unit
final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( org . jboss . as . ee . component . Attachments . EE_MODULE_DESCRIPTION ) ; final EEApplicationClasses applicationClassesDescription = deploymentUnit . getAttachment ( org . jboss . as . ee . component . Attachments . EE_APPLICATION_CLASSES_DESCRIPTION ) ; final EjbJarMetaData ejbJarMetaData ; final EjbJarMetaData specMetaData = parseEjbJarXml ( deploymentUnit ) ; final EjbJarMetaData jbossMetaData = parseJBossEjb3Xml ( deploymentUnit ) ; if ( specMetaData == null ) { if ( jbossMetaData == null ) return ; ejbJarMetaData = jbossMetaData ; } else if ( jbossMetaData == null ) { ejbJarMetaData = specMetaData ; } else { ejbJarMetaData = jbossMetaData . createMerged ( specMetaData ) ; } // Mark it as an EJB deployment
EjbDeploymentMarker . mark ( deploymentUnit ) ; if ( ! deploymentUnit . hasAttachment ( EjbDeploymentAttachmentKeys . EJB_JAR_DESCRIPTION ) ) { final EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( org . jboss . as . ee . component . Attachments . EE_MODULE_DESCRIPTION ) ; final EjbJarDescription ejbModuleDescription = new EjbJarDescription ( moduleDescription , deploymentUnit . getName ( ) . endsWith ( ".war" ) ) ; deploymentUnit . putAttachment ( EjbDeploymentAttachmentKeys . EJB_JAR_DESCRIPTION , ejbModuleDescription ) ; } // attach the EjbJarMetaData to the deployment unit
deploymentUnit . putAttachment ( EjbDeploymentAttachmentKeys . EJB_JAR_METADATA , ejbJarMetaData ) ; // if the jboss - ejb3 . xml has a distinct - name configured then attach it to the deployment unit
if ( jbossMetaData != null && jbossMetaData . getDistinctName ( ) != null ) { deploymentUnit . putAttachment ( org . jboss . as . ee . structure . Attachments . DISTINCT_NAME , jbossMetaData . getDistinctName ( ) ) ; } if ( ejbJarMetaData . getModuleName ( ) != null ) { eeModuleDescription . setModuleName ( ejbJarMetaData . getModuleName ( ) ) ; } if ( ejbJarMetaData . isMetadataComplete ( ) ) { MetadataCompleteMarker . setMetadataComplete ( deploymentUnit , true ) ; } if ( ! ejbJarMetaData . isEJB3x ( ) ) { // EJB spec 20.5.1 , we do not process annotations for older deployments
MetadataCompleteMarker . setMetadataComplete ( deploymentUnit , true ) ; } if ( ejbJarMetaData . getEnterpriseBeans ( ) != null ) { // check for entity beans
StringBuilder beans = new StringBuilder ( ) ; boolean error = false ; for ( AbstractEnterpriseBeanMetaData bean : ejbJarMetaData . getEnterpriseBeans ( ) ) { if ( bean . getEjbType ( ) == EjbType . ENTITY ) { if ( ! error ) { error = true ; } else { beans . append ( ", " ) ; } beans . append ( bean . getEjbName ( ) ) ; } } if ( error ) { throw EjbLogger . ROOT_LOGGER . entityBeansAreNotSupported ( beans . toString ( ) ) ; } }


signature:
public class EjbJarParsingDeploymentUnitProcessor { /** * Creates and returns a { @ link XMLStreamReader } for the passed { @ link VirtualFile ejb - jar . xml }
 * @ param stream The input stream
 * @ param ejbJarXml
 * @ return
 * @ throws DeploymentUnitProcessingException */
private static XMLStreamReader getXMLStreamReader ( InputStream stream , VirtualFile ejbJarXml , XMLResolver resolver ) throws DeploymentUnitProcessingException { } }

implementation: try { final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( resolver ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( stream ) ; return xmlReader ; } catch ( XMLStreamException xmlse ) { throw EjbLogger . ROOT_LOGGER . failedToParse ( xmlse , "ejb-jar.xml: " + ejbJarXml . getPathName ( ) ) ; }


signature:
public class WarJACCService { /** * { @ inheritDoc } */
@ Override public void createPermissions ( WarMetaData metaData , PolicyConfiguration pc ) throws PolicyContextException { } }

implementation:
JBossWebMetaData jbossWebMetaData = metaData . getMergedJBossWebMetaData ( ) ; HashMap < String , PatternInfo > patternMap = qualifyURLPatterns ( jbossWebMetaData ) ; List < SecurityConstraintMetaData > secConstraints = jbossWebMetaData . getSecurityConstraints ( ) ; if ( secConstraints != null ) { for ( SecurityConstraintMetaData secConstraint : secConstraints ) { WebResourceCollectionsMetaData resourceCollectionsMetaData = secConstraint . getResourceCollections ( ) ; UserDataConstraintMetaData userDataConstraintMetaData = secConstraint . getUserDataConstraint ( ) ; if ( resourceCollectionsMetaData != null ) { if ( secConstraint . isExcluded ( ) || secConstraint . isUnchecked ( ) ) { // Process the permissions for the excluded / unchecked resources
for ( WebResourceCollectionMetaData resourceCollectionMetaData : resourceCollectionsMetaData ) { List < String > httpMethods = new ArrayList < > ( resourceCollectionMetaData . getHttpMethods ( ) ) ; List < String > ommisions = resourceCollectionMetaData . getHttpMethodOmissions ( ) ; if ( httpMethods . isEmpty ( ) && ! ommisions . isEmpty ( ) ) { httpMethods . addAll ( WebResourceCollectionMetaData . ALL_HTTP_METHODS ) ; httpMethods . removeAll ( ommisions ) ; } List < String > urlPatterns = resourceCollectionMetaData . getUrlPatterns ( ) ; for ( String urlPattern : urlPatterns ) { PatternInfo info = patternMap . get ( urlPattern ) ; info . descriptor = true ; // Add the excluded methods
if ( secConstraint . isExcluded ( ) ) { info . addExcludedMethods ( httpMethods ) ; } // SECURITY - 63 : Missing auth - constraint needs unchecked policy
if ( secConstraint . isUnchecked ( ) && httpMethods . isEmpty ( ) ) { info . isMissingAuthConstraint = true ; } else { info . missingAuthConstraintMethods . addAll ( httpMethods ) ; } } } } else { // Process the permission for the resources x roles
for ( WebResourceCollectionMetaData resourceCollectionMetaData : resourceCollectionsMetaData ) { List < String > httpMethods = new ArrayList < > ( resourceCollectionMetaData . getHttpMethods ( ) ) ; List < String > methodOmissions = resourceCollectionMetaData . getHttpMethodOmissions ( ) ; if ( httpMethods . isEmpty ( ) && ! methodOmissions . isEmpty ( ) ) { httpMethods . addAll ( WebResourceCollectionMetaData . ALL_HTTP_METHODS ) ; httpMethods . removeAll ( methodOmissions ) ; } List < String > urlPatterns = resourceCollectionMetaData . getUrlPatterns ( ) ; for ( String urlPattern : urlPatterns ) { // Get the qualified url pattern
PatternInfo info = patternMap . get ( urlPattern ) ; info . descriptor = true ; HashSet < String > mappedRoles = new HashSet < String > ( ) ; secConstraint . getAuthConstraint ( ) . getRoleNames ( ) ; List < String > authRoles = secConstraint . getAuthConstraint ( ) . getRoleNames ( ) ; for ( String role : authRoles ) { if ( "*" . equals ( role ) ) { // The wildcard ref maps to all declared security - role names
mappedRoles . addAll ( jbossWebMetaData . getSecurityRoleNames ( ) ) ; } else { mappedRoles . add ( role ) ; } } info . addRoles ( mappedRoles , httpMethods ) ; // Add the transport to methods
if ( userDataConstraintMetaData != null && userDataConstraintMetaData . getTransportGuarantee ( ) != null ) info . addTransport ( userDataConstraintMetaData . getTransportGuarantee ( ) . name ( ) , httpMethods ) ; } } } } } } JBossServletsMetaData servlets = jbossWebMetaData . getServlets ( ) ; List < ServletMappingMetaData > mappings = jbossWebMetaData . getServletMappings ( ) ; if ( servlets != null && mappings != null ) { Map < String , List < String > > servletMappingMap = new HashMap < > ( ) ; for ( ServletMappingMetaData mapping : mappings ) { List < String > list = servletMappingMap . get ( mapping . getServletName ( ) ) ; if ( list == null ) { servletMappingMap . put ( mapping . getServletName ( ) , list = new ArrayList < > ( ) ) ; } list . addAll ( mapping . getUrlPatterns ( ) ) ; } if ( ! jbossWebMetaData . isMetadataComplete ( ) ) { for ( JBossServletMetaData servlet : servlets ) { ServletSecurityMetaData security = servlet . getServletSecurity ( ) ; if ( security != null ) { List < String > servletMappings = servletMappingMap . get ( servlet . getServletName ( ) ) ; if ( servletMappings != null ) { if ( security . getHttpMethodConstraints ( ) != null ) { for ( HttpMethodConstraintMetaData s : security . getHttpMethodConstraints ( ) ) { if ( s . getRolesAllowed ( ) == null || s . getRolesAllowed ( ) . isEmpty ( ) ) { for ( String urlPattern : servletMappings ) { // Get the qualified url pattern
PatternInfo info = patternMap . get ( urlPattern ) ; if ( info . descriptor ) { continue ; } // Add the excluded methods
if ( s . getEmptyRoleSemantic ( ) == null || s . getEmptyRoleSemantic ( ) == EmptyRoleSemanticType . PERMIT ) { info . missingAuthConstraintMethods . add ( s . getMethod ( ) ) ; } else { info . addExcludedMethods ( Collections . singletonList ( s . getMethod ( ) ) ) ; } // Add the transport to methods
if ( s . getTransportGuarantee ( ) != null ) info . addTransport ( s . getTransportGuarantee ( ) . name ( ) , Collections . singletonList ( s . getMethod ( ) ) ) ; } } else { for ( String urlPattern : servletMappings ) { // Get the qualified url pattern
PatternInfo info = patternMap . get ( urlPattern ) ; if ( info . descriptor ) { continue ; } HashSet < String > mappedRoles = new HashSet < String > ( ) ; List < String > authRoles = s . getRolesAllowed ( ) ; for ( String role : authRoles ) { if ( "*" . equals ( role ) ) { // The wildcard ref maps to all declared security - role names
mappedRoles . addAll ( jbossWebMetaData . getSecurityRoleNames ( ) ) ; } else { mappedRoles . add ( role ) ; } } info . addRoles ( mappedRoles , Collections . singletonList ( s . getMethod ( ) ) ) ; // Add the transport to methods
if ( s . getTransportGuarantee ( ) != null ) info . addTransport ( s . getTransportGuarantee ( ) . name ( ) , Collections . singletonList ( s . getMethod ( ) ) ) ; } } } } if ( security . getRolesAllowed ( ) == null || security . getRolesAllowed ( ) . isEmpty ( ) ) { for ( String urlPattern : servletMappings ) { // Get the qualified url pattern
PatternInfo info = patternMap . get ( urlPattern ) ; if ( info . descriptor ) { continue ; } // Add the excluded methods
if ( security . getEmptyRoleSemantic ( ) == null || security . getEmptyRoleSemantic ( ) == EmptyRoleSemanticType . PERMIT ) { info . isMissingAuthConstraint = true ; } else { Set < String > methods = new HashSet < > ( WebResourceCollectionMetaData . ALL_HTTP_METHODS ) ; if ( security . getHttpMethodConstraints ( ) != null ) { for ( HttpMethodConstraintMetaData method : security . getHttpMethodConstraints ( ) ) { methods . remove ( method . getMethod ( ) ) ; } } info . addExcludedMethods ( new ArrayList < > ( methods ) ) ; } // Add the transport to methods
if ( security . getTransportGuarantee ( ) != null ) info . addTransport ( security . getTransportGuarantee ( ) . name ( ) , Collections . emptyList ( ) ) ; } } else { for ( String urlPattern : servletMappings ) { // Get the qualified url pattern
PatternInfo info = patternMap . get ( urlPattern ) ; if ( info . descriptor ) { continue ; } HashSet < String > mappedRoles = new HashSet < String > ( ) ; List < String > authRoles = security . getRolesAllowed ( ) ; for ( String role : authRoles ) { if ( "*" . equals ( role ) ) { // The wildcard ref maps to all declared security - role names
mappedRoles . addAll ( jbossWebMetaData . getSecurityRoleNames ( ) ) ; } else { mappedRoles . add ( role ) ; } } info . addRoles ( mappedRoles , Collections . emptyList ( ) ) ; // Add the transport to methods
if ( security . getTransportGuarantee ( ) != null ) info . addTransport ( security . getTransportGuarantee ( ) . name ( ) , Collections . emptyList ( ) ) ; } } } } } } } // Create the permissions
for ( PatternInfo info : patternMap . values ( ) ) { String qurl = info . getQualifiedPattern ( ) ; if ( info . isOverridden ) { continue ; } // Create the excluded permissions
String [ ] httpMethods = info . getExcludedMethods ( ) ; if ( httpMethods != null ) { // There were excluded security - constraints
WebResourcePermission wrp = new WebResourcePermission ( qurl , httpMethods ) ; WebUserDataPermission wudp = new WebUserDataPermission ( qurl , httpMethods , null ) ; pc . addToExcludedPolicy ( wrp ) ; pc . addToExcludedPolicy ( wudp ) ; } // Create the role permissions
Iterator < Map . Entry < String , Set < String > > > roles = info . getRoleMethods ( ) ; Set < String > seenMethods = new HashSet < > ( ) ; while ( roles . hasNext ( ) ) { Map . Entry < String , Set < String > > roleMethods = roles . next ( ) ; String role = roleMethods . getKey ( ) ; Set < String > methods = roleMethods . getValue ( ) ; seenMethods . addAll ( methods ) ; httpMethods = methods . toArray ( new String [ methods . size ( ) ] ) ; pc . addToRole ( role , new WebResourcePermission ( qurl , httpMethods ) ) ; } // there are totally 7 http methods from the jacc spec ( See WebResourceCollectionMetaData . ALL _ HTTP _ METHOD _ NAMES )
final int NUMBER_OF_HTTP_METHODS = 7 ; // JACC 1.1 : create ! ( httpmethods ) in unchecked perms
if ( jbossWebMetaData . getDenyUncoveredHttpMethods ( ) == null ) { if ( seenMethods . size ( ) != NUMBER_OF_HTTP_METHODS ) { WebResourcePermission wrpUnchecked = new WebResourcePermission ( qurl , "!" + getCommaSeparatedString ( seenMethods . toArray ( new String [ seenMethods . size ( ) ] ) ) ) ; pc . addToUncheckedPolicy ( wrpUnchecked ) ; } } if ( jbossWebMetaData . getDenyUncoveredHttpMethods ( ) == null ) { // Create the unchecked permissions
String [ ] missingHttpMethods = info . getMissingMethods ( ) ; int length = missingHttpMethods . length ; roles = info . getRoleMethods ( ) ; if ( length > 0 && ! roles . hasNext ( ) ) { // Create the unchecked permissions WebResourcePermissions
WebResourcePermission wrp = new WebResourcePermission ( qurl , missingHttpMethods ) ; pc . addToUncheckedPolicy ( wrp ) ; } else if ( ! roles . hasNext ( ) ) { pc . addToUncheckedPolicy ( new WebResourcePermission ( qurl , ( String ) null ) ) ; } // SECURITY - 63 : Missing auth - constraint needs unchecked policy
if ( info . isMissingAuthConstraint ) { pc . addToUncheckedPolicy ( new WebResourcePermission ( qurl , ( String ) null ) ) ; } else if ( ! info . allMethods . containsAll ( WebResourceCollectionMetaData . ALL_HTTP_METHODS ) ) { List < String > methods = new ArrayList < > ( WebResourceCollectionMetaData . ALL_HTTP_METHODS ) ; methods . removeAll ( info . allMethods ) ; pc . addToUncheckedPolicy ( new WebResourcePermission ( qurl , methods . toArray ( new String [ methods . size ( ) ] ) ) ) ; } if ( ! info . missingAuthConstraintMethods . isEmpty ( ) ) { pc . addToUncheckedPolicy ( new WebResourcePermission ( qurl , info . missingAuthConstraintMethods . toArray ( new String [ info . missingAuthConstraintMethods . size ( ) ] ) ) ) ; } } // Create the unchecked permissions WebUserDataPermissions
Iterator < Map . Entry < String , Set < String > > > transportConstraints = info . getTransportMethods ( ) ; while ( transportConstraints . hasNext ( ) ) { Map . Entry < String , Set < String > > transportMethods = transportConstraints . next ( ) ; String transport = transportMethods . getKey ( ) ; Set < String > methods = transportMethods . getValue ( ) ; httpMethods = new String [ methods . size ( ) ] ; methods . toArray ( httpMethods ) ; WebUserDataPermission wudp = new WebUserDataPermission ( qurl , httpMethods , transport ) ; pc . addToUncheckedPolicy ( wudp ) ; // If the transport is " NONE " , then add an exclusive WebUserDataPermission
// with the url pattern and null
if ( "NONE" . equals ( transport ) ) { WebUserDataPermission wudp1 = new WebUserDataPermission ( qurl , null ) ; pc . addToUncheckedPolicy ( wudp1 ) ; } else { // JACC 1.1 : Transport is CONFIDENTIAL / INTEGRAL , add a ! ( http methods )
WebUserDataPermission wudpNonNull = new WebUserDataPermission ( qurl , "!" + getCommaSeparatedString ( httpMethods ) ) ; pc . addToUncheckedPolicy ( wudpNonNull ) ; } } } Set < String > declaredRoles = jbossWebMetaData . getSecurityRoleNames ( ) ; declaredRoles . add ( ANY_AUTHENTICATED_USER_ROLE ) ; /* * Create WebRoleRefPermissions for all servlet / security - role - refs along with all the cross product of servlets and
 * security - role elements that are not referenced via a security - role - ref as described in JACC section 3.1.3.2 */
JBossServletsMetaData servletsMetaData = jbossWebMetaData . getServlets ( ) ; for ( JBossServletMetaData servletMetaData : servletsMetaData ) { Set < String > unrefRoles = new HashSet < String > ( declaredRoles ) ; String servletName = servletMetaData . getName ( ) ; SecurityRoleRefsMetaData roleRefsMetaData = servletMetaData . getSecurityRoleRefs ( ) ; // Perform the unreferenced roles processing for every servlet name
if ( roleRefsMetaData != null ) { for ( SecurityRoleRefMetaData roleRefMetaData : roleRefsMetaData ) { String roleRef = roleRefMetaData . getRoleLink ( ) ; String roleName = roleRefMetaData . getRoleName ( ) ; WebRoleRefPermission wrrp = new WebRoleRefPermission ( servletName , roleName ) ; pc . addToRole ( roleRef , wrrp ) ; // Remove the role from the unreferencedRoles
unrefRoles . remove ( roleName ) ; } } // Spec 3.1.3.2 : For each servlet element in the deployment descriptor
// a WebRoleRefPermission must be added to each security - role of the
// application whose name does not appear as the rolename
// in a security - role - ref within the servlet element .
for ( String unrefRole : unrefRoles ) { WebRoleRefPermission unrefP = new WebRoleRefPermission ( servletName , unrefRole ) ; pc . addToRole ( unrefRole , unrefP ) ; } } // JACC 1.1 : Spec 3.1.3.2 : For each security - role defined in the deployment descriptor , an
// additional WebRoleRefPermission must be added to the corresponding role by
// calling the addToRole method on the PolicyConfiguration object . The
// name of all such permissions must be the empty string , and the actions of each
// such permission must be the role - name of the corresponding role .
for ( String role : declaredRoles ) { WebRoleRefPermission wrrep = new WebRoleRefPermission ( "" , role ) ; pc . addToRole ( role , wrrep ) ; }


signature:
public class WarJACCService { /** * Determine the url - pattern type
 * @ param urlPattern - the raw url - pattern value
 * @ return one of EXACT , EXTENSION , PREFIX , DEFAULT */
static int getPatternType ( String urlPattern ) { } }

implementation: int type = EXACT ; if ( urlPattern . startsWith ( "*." ) ) type = EXTENSION ; else if ( urlPattern . startsWith ( "/" ) && urlPattern . endsWith ( "/*" ) ) type = PREFIX ; else if ( urlPattern . equals ( "/" ) ) type = DEFAULT ; return type ;


signature:
public class WarJACCService { /** * JACC url pattern Qualified URL Pattern Names .
 * The rules for qualifying a URL pattern are dependent on the rules for determining if one URL pattern matches another as
 * defined in Section 3.1.3.3 , Servlet URL - Pattern Matching Rules , and are described as follows : - If the pattern is a path
 * prefix pattern , it must be qualified by every path - prefix pattern in the deployment descriptor matched by and different
 * from the pattern being qualified . The pattern must also be qualified by every exact pattern appearing in the deployment
 * descriptor that is matched by the pattern being qualified . - If the pattern is an extension pattern , it must be qualified
 * by every path - prefix pattern appearing in the deployment descriptor and every exact pattern in the deployment descriptor
 * that is matched by the pattern being qualified . - If the pattern is the default pattern , " / " , it must be qualified by
 * every other pattern except the default pattern appearing in the deployment descriptor . - If the pattern is an exact
 * pattern , its qualified form must not contain any qualifying patterns .
 * URL patterns are qualified by appending to their String representation , a colon separated representation of the list of
 * patterns that qualify the pattern . Duplicates must not be included in the list of qualifying patterns , and any qualifying
 * pattern matched by another qualifying pattern may5 be dropped from the list .
 * Any pattern , qualified by a pattern that matches it , is overridden and made irrelevant ( in the translation ) by the
 * qualifying pattern . Specifically , all extension patterns and the default pattern are made irrelevant by the presence of
 * the path prefix pattern " / * " in a deployment descriptor . Patterns qualified by the " / * " pattern violate the
 * URLPatternSpec constraints of WebResourcePermission and WebUserDataPermission names and must be rejected by the
 * corresponding permission constructors .
 * @ param metaData - the web deployment metadata
 * @ return HashMap < String , PatternInfo > */
static HashMap < String , PatternInfo > qualifyURLPatterns ( JBossWebMetaData metaData ) { } }

implementation:
ArrayList < PatternInfo > prefixList = new ArrayList < PatternInfo > ( ) ; ArrayList < PatternInfo > extensionList = new ArrayList < PatternInfo > ( ) ; ArrayList < PatternInfo > exactList = new ArrayList < PatternInfo > ( ) ; HashMap < String , PatternInfo > patternMap = new HashMap < String , PatternInfo > ( ) ; PatternInfo defaultInfo = null ; List < SecurityConstraintMetaData > constraints = metaData . getSecurityConstraints ( ) ; if ( constraints != null ) { for ( SecurityConstraintMetaData constraint : constraints ) { WebResourceCollectionsMetaData resourceCollectionsMetaData = constraint . getResourceCollections ( ) ; if ( resourceCollectionsMetaData != null ) { for ( WebResourceCollectionMetaData resourceCollectionMetaData : resourceCollectionsMetaData ) { List < String > urlPatterns = resourceCollectionMetaData . getUrlPatterns ( ) ; for ( String url : urlPatterns ) { int type = getPatternType ( url ) ; PatternInfo info = patternMap . get ( url ) ; if ( info == null ) { info = new PatternInfo ( url , type ) ; patternMap . put ( url , info ) ; switch ( type ) { case PREFIX : prefixList . add ( info ) ; break ; case EXTENSION : extensionList . add ( info ) ; break ; case EXACT : exactList . add ( info ) ; break ; case DEFAULT : defaultInfo = info ; break ; } } } } } } } JBossServletsMetaData servlets = metaData . getServlets ( ) ; List < ServletMappingMetaData > mappings = metaData . getServletMappings ( ) ; if ( ! metaData . isMetadataComplete ( ) && servlets != null && mappings != null ) { Map < String , List < String > > servletMappingMap = new HashMap < > ( ) ; for ( ServletMappingMetaData mapping : mappings ) { List < String > list = servletMappingMap . get ( mapping . getServletName ( ) ) ; if ( list == null ) { servletMappingMap . put ( mapping . getServletName ( ) , list = new ArrayList < > ( ) ) ; } list . addAll ( mapping . getUrlPatterns ( ) ) ; } for ( JBossServletMetaData servlet : servlets ) { ServletSecurityMetaData security = servlet . getServletSecurity ( ) ; if ( security != null ) { List < String > servletMappings = servletMappingMap . get ( servlet . getServletName ( ) ) ; if ( servletMappings != null ) { for ( String url : servletMappings ) { int type = getPatternType ( url ) ; PatternInfo info = patternMap . get ( url ) ; if ( info == null ) { info = new PatternInfo ( url , type ) ; patternMap . put ( url , info ) ; switch ( type ) { case PREFIX : prefixList . add ( info ) ; break ; case EXTENSION : extensionList . add ( info ) ; break ; case EXACT : exactList . add ( info ) ; break ; case DEFAULT : defaultInfo = info ; break ; } } } } } } } // Qualify all prefix patterns
for ( int i = 0 ; i < prefixList . size ( ) ; i ++ ) { PatternInfo info = prefixList . get ( i ) ; // Qualify by every other prefix pattern matching this pattern
for ( int j = 0 ; j < prefixList . size ( ) ; j ++ ) { if ( i == j ) continue ; PatternInfo other = prefixList . get ( j ) ; if ( info . matches ( other ) ) info . addQualifier ( other ) ; } // Qualify by every exact pattern that is matched by this pattern
for ( PatternInfo other : exactList ) { if ( info . matches ( other ) ) info . addQualifier ( other ) ; } } // Qualify all extension patterns
for ( PatternInfo info : extensionList ) { // Qualify by every path prefix pattern
for ( PatternInfo other : prefixList ) { // Any extension
info . addQualifier ( other ) ; } // Qualify by every matching exact pattern
for ( PatternInfo other : exactList ) { if ( info . isExtensionFor ( other ) ) info . addQualifier ( other ) ; } } // Qualify the default pattern
if ( defaultInfo == null ) { defaultInfo = new PatternInfo ( "/" , DEFAULT ) ; patternMap . put ( "/" , defaultInfo ) ; } for ( PatternInfo info : patternMap . values ( ) ) { if ( info == defaultInfo ) continue ; defaultInfo . addQualifier ( info ) ; } return patternMap ;


signature:
public class ExtendedEntityManager { /** * Associate the extended persistence context with the current JTA transaction ( if one is found )
 * this method is private to the JPA subsystem */
public void internalAssociateWithJtaTx ( ) { } }

implementation:
isInTx = TransactionUtil . isInTx ( transactionManager ) ; // ensure that a different XPC ( with same name ) is not already present in the TX
if ( isInTx ) { // 7.6.3.1 throw EJBException if a different persistence context is already joined to the
// transaction ( with the same puScopedName ) .
EntityManager existing = TransactionUtil . getTransactionScopedEntityManager ( puScopedName , transactionSynchronizationRegistry ) ; if ( existing != null && existing != this ) { // should be enough to test if not the same object
throw JpaLogger . ROOT_LOGGER . cannotUseExtendedPersistenceTransaction ( puScopedName , existing , this ) ; } else if ( existing == null ) { if ( SynchronizationType . SYNCHRONIZED . equals ( synchronizationType ) ) { // JPA 7.9.1 join the transaction if not already done for SynchronizationType . SYNCHRONIZED .
underlyingEntityManager . joinTransaction ( ) ; } // associate the entity manager with the current transaction
TransactionUtil . putEntityManagerInTransactionRegistry ( puScopedName , this , transactionSynchronizationRegistry ) ; } }


signature:
public class JMSConnectionFactoryDefinitionInjectionSource { /** * Return whether the definition targets an existing pooled connection factory or use a JCA - based ConnectionFactory .
 * Checks the service registry for a PooledConnectionFactoryService with the ServiceName
 * created by the { @ code server } property ( or { @ code " default " ) and the { @ code resourceAdapter } property . */
static boolean targetsPooledConnectionFactory ( String server , String resourceAdapter , ServiceRegistry serviceRegistry ) { } }

implementation:
// if the resourceAdapter is not defined , the default behaviour is to create a pooled - connection - factory .
if ( resourceAdapter == null || resourceAdapter . isEmpty ( ) ) { return true ; } ServiceName activeMQServiceName = MessagingServices . getActiveMQServiceName ( server ) ; ServiceName pcfName = JMSServices . getPooledConnectionFactoryBaseServiceName ( activeMQServiceName ) . append ( resourceAdapter ) ; return serviceRegistry . getServiceNames ( ) . contains ( pcfName ) ;


signature:
public class JMSConnectionFactoryDefinitionInjectionSource { /** * Return whether the definition targets an existing external pooled connection factory .
 * Checks the service registry for a PooledConnectionFactoryService with the ServiceName
 * created by the { @ code server } property ( or { @ code " default " ) and the { @ code resourceAdapter } property . */
static boolean targetsExternalPooledConnectionFactory ( String resourceAdapter , ServiceRegistry serviceRegistry ) { } }

implementation:
// if the resourceAdapter is not defined , the default behaviour is to create a pooled - connection - factory .
if ( resourceAdapter == null || resourceAdapter . isEmpty ( ) ) { return false ; } // let ' s look into the external - pooled - connection - factory
ServiceName pcfName = JMSServices . getPooledConnectionFactoryBaseServiceName ( MessagingServices . getActiveMQServiceName ( "" ) ) . append ( resourceAdapter ) ; return serviceRegistry . getServiceNames ( ) . contains ( pcfName ) ;


signature:
public class JMSConnectionFactoryDefinitionInjectionSource { /** * The JMS connection factory can specify another server to deploy its destinations
 * by passing a property server = & lt ; name of the server > . Otherwise , " default " is used by default . */
static String getActiveMQServerName ( Map < String , String > properties ) { } }

implementation: return properties . getOrDefault ( SERVER , DEFAULT ) ;


signature:
public class PersistenceUnitSearch { /** * When finding the default persistence unit , the first persistence unit encountered is returned . */
private static PersistenceUnitMetadata findWithinDeployment ( DeploymentUnit unit , String persistenceUnitName ) { } }

implementation: if ( traceEnabled ) { ROOT_LOGGER . tracef ( "pu findWithinDeployment searching for %s" , persistenceUnitName ) ; } for ( ResourceRoot root : DeploymentUtils . allResourceRoots ( unit ) ) { PersistenceUnitMetadataHolder holder = root . getAttachment ( PersistenceUnitMetadataHolder . PERSISTENCE_UNITS ) ; if ( holder == null || holder . getPersistenceUnits ( ) == null ) { if ( traceEnabled ) { ROOT_LOGGER . tracef ( "pu findWithinDeployment skipping empty pu holder for %s" , persistenceUnitName ) ; } continue ; } ambiguousPUError ( unit , persistenceUnitName , holder ) ; persistenceUnitName = defaultPersistenceUnitName ( persistenceUnitName , holder ) ; for ( PersistenceUnitMetadata persistenceUnit : holder . getPersistenceUnits ( ) ) { if ( traceEnabled ) { ROOT_LOGGER . tracef ( "findWithinDeployment check '%s' against pu '%s'" , persistenceUnitName , persistenceUnit . getPersistenceUnitName ( ) ) ; } if ( persistenceUnitName == null || persistenceUnitName . length ( ) == 0 || persistenceUnit . getPersistenceUnitName ( ) . equals ( persistenceUnitName ) ) { if ( traceEnabled ) { ROOT_LOGGER . tracef ( "findWithinDeployment matched '%s' against pu '%s'" , persistenceUnitName , persistenceUnit . getPersistenceUnitName ( ) ) ; } return persistenceUnit ; } } } return null ;


signature:
public class PersistenceUnitSearch { /** * if no persistence unit name is specified , return name of default persistence unit
 * @ param persistenceUnitName that was specified to be used ( null means to use the default persistence unit )
 * @ param holder
 * @ return */
private static String defaultPersistenceUnitName ( String persistenceUnitName , PersistenceUnitMetadataHolder holder ) { } }

implementation: if ( ( persistenceUnitName == null || persistenceUnitName . length ( ) == 0 ) ) { for ( PersistenceUnitMetadata persistenceUnit : holder . getPersistenceUnits ( ) ) { String defaultPU = persistenceUnit . getProperties ( ) . getProperty ( Configuration . JPA_DEFAULT_PERSISTENCE_UNIT ) ; if ( Boolean . TRUE . toString ( ) . equals ( defaultPU ) ) { persistenceUnitName = persistenceUnit . getPersistenceUnitName ( ) ; } } } return persistenceUnitName ;


signature:
public class ParsedRaDeploymentProcessor { /** * Process a deployment for a Connector . Will install a { @ Code
 * JBossService } for this ResourceAdapter .
 * @ param phaseContext the deployment unit context
 * @ throws DeploymentUnitProcessingException */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation:
final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ConnectorXmlDescriptor connectorXmlDescriptor = deploymentUnit . getAttachment ( ConnectorXmlDescriptor . ATTACHMENT_KEY ) ; final ManagementResourceRegistration registration ; final ManagementResourceRegistration baseRegistration = deploymentUnit . getAttachment ( DeploymentModelUtils . MUTABLE_REGISTRATION_ATTACHMENT ) ; final Resource deploymentResource = deploymentUnit . getAttachment ( DeploymentModelUtils . DEPLOYMENT_RESOURCE ) ; final CapabilityServiceSupport support = deploymentUnit . getAttachment ( Attachments . CAPABILITY_SERVICE_SUPPORT ) ; if ( connectorXmlDescriptor == null ) { return ; } final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; if ( deploymentUnit . getParent ( ) != null ) { registration = baseRegistration . getSubModel ( PathAddress . pathAddress ( PathElement . pathElement ( "subdeployment" ) ) ) ; } else { registration = baseRegistration ; } final IronJacamarXmlDescriptor ironJacamarXmlDescriptor = deploymentUnit . getAttachment ( IronJacamarXmlDescriptor . ATTACHMENT_KEY ) ; final Module module = deploymentUnit . getAttachment ( Attachments . MODULE ) ; DEPLOYMENT_CONNECTOR_LOGGER . debugf ( "ParsedRaDeploymentProcessor: Processing=%s" , deploymentUnit ) ; final ClassLoader classLoader = module . getClassLoader ( ) ; Map < ResourceRoot , Index > annotationIndexes = AnnotationIndexUtils . getAnnotationIndexes ( deploymentUnit ) ; ServiceBuilder builder = process ( connectorXmlDescriptor , ironJacamarXmlDescriptor , classLoader , serviceTarget , annotationIndexes , deploymentUnit . getServiceName ( ) , registration , deploymentResource , support ) ; if ( builder != null ) { String bootstrapCtx = null ; if ( ironJacamarXmlDescriptor != null && ironJacamarXmlDescriptor . getIronJacamar ( ) != null && ironJacamarXmlDescriptor . getIronJacamar ( ) . getBootstrapContext ( ) != null ) bootstrapCtx = ironJacamarXmlDescriptor . getIronJacamar ( ) . getBootstrapContext ( ) ; if ( bootstrapCtx == null ) bootstrapCtx = "default" ; builder . requires ( ConnectorServices . BOOTSTRAP_CONTEXT_SERVICE . append ( bootstrapCtx ) ) ; // Register an empty override model regardless of we ' re enabled or not - the statistics listener will add the relevant childresources
if ( registration . isAllowsOverride ( ) && registration . getOverrideModel ( deploymentUnit . getName ( ) ) == null ) { registration . registerOverrideModel ( deploymentUnit . getName ( ) , new OverrideDescriptionProvider ( ) { @ Override public Map < String , ModelNode > getAttributeOverrideDescriptions ( Locale locale ) { return Collections . emptyMap ( ) ; } @ Override public Map < String , ModelNode > getChildTypeOverrideDescriptions ( Locale locale ) { return Collections . emptyMap ( ) ; } } ) ; } builder . setInitialMode ( Mode . ACTIVE ) . install ( ) ; }


signature:
public class Reflections { /** * A simple implementation of the { @ link org . jboss . weld . resources . spi . AnnotationDiscovery # containsAnnotation ( Class , Class ) } contract .
 * This implementation uses reflection .
 * @ see org . jboss . as . weld . discovery . WeldAnnotationDiscovery */
public static boolean containsAnnotation ( Class < ? > javaClass , Class < ? extends Annotation > requiredAnnotation ) { } }

implementation:
for ( Class < ? > clazz = javaClass ; clazz != null && clazz != Object . class ; clazz = clazz . getSuperclass ( ) ) { // class level annotations
if ( clazz == javaClass || requiredAnnotation . isAnnotationPresent ( Inherited . class ) ) { if ( containsAnnotations ( clazz . getAnnotations ( ) , requiredAnnotation ) ) { return true ; } } // fields
for ( Field field : clazz . getDeclaredFields ( ) ) { if ( containsAnnotations ( field . getAnnotations ( ) , requiredAnnotation ) ) { return true ; } } // constructors
for ( Constructor < ? > constructor : clazz . getConstructors ( ) ) { if ( containsAnnotations ( constructor . getAnnotations ( ) , requiredAnnotation ) ) { return true ; } for ( Annotation [ ] parameterAnnotations : constructor . getParameterAnnotations ( ) ) { if ( containsAnnotations ( parameterAnnotations , requiredAnnotation ) ) { return true ; } } } // methods
for ( Method method : clazz . getDeclaredMethods ( ) ) { if ( containsAnnotations ( method . getAnnotations ( ) , requiredAnnotation ) ) { return true ; } for ( Annotation [ ] parameterAnnotations : method . getParameterAnnotations ( ) ) { if ( containsAnnotations ( parameterAnnotations , requiredAnnotation ) ) { return true ; } } } } return false ;


signature:
public class EJBSuspendHandlerService { /** * Starts the service . Registers server activity , sets transaction listener on local transaction context , and creates and
 * installs deployment controller service .
 * @ param context start context */
public void start ( StartContext context ) { } }

implementation: final SuspendController suspendController = suspendControllerInjectedValue . getValue ( ) ; suspendController . registerActivity ( this ) ; final LocalTransactionContext localTransactionContext = localTransactionContextInjectedValue . getValue ( ) ; localTransactionContext . registerCreationListener ( this ) ;


signature:
public class EJBSuspendHandlerService { /** * Stops the service . Unregisters service activity and clears transaction listener .
 * @ param context stop context */
public void stop ( StopContext context ) { } }

implementation: final SuspendController suspendController = suspendControllerInjectedValue . getValue ( ) ; suspendController . unRegisterActivity ( this ) ; final LocalTransactionContext localTransactionContext = localTransactionContextInjectedValue . getValue ( ) ; localTransactionContext . removeCreationListener ( this ) ;


signature:
public class EJBSuspendHandlerService { /** * Notifies local transaction context that server is suspended , and only completes suspension if
 * there are no active invocations nor transactions .
 * @ param listener callback listener */
@ Override public void suspended ( ServerActivityCallback listener ) { } }

implementation: this . suspended = true ; listenerUpdater . set ( this , listener ) ; localTransactionContextInjectedValue . getValue ( ) . suspendRequests ( ) ; final int activeInvocationCount = activeInvocationCountUpdater . get ( this ) ; if ( activeInvocationCount == 0 ) { if ( gracefulTxnShutdown ) { if ( activeTransactionCountUpdater . get ( this ) == 0 ) { this . doneSuspended ( ) ; } else { EjbLogger . ROOT_LOGGER . suspensionWaitingActiveTransactions ( activeInvocationCount ) ; } } else { this . doneSuspended ( ) ; } }


signature:
public class EJBSuspendHandlerService { /** * Notifies local transaction context that server is resumed , and restarts deployment controller . */
@ Override public void resume ( ) { } }

implementation: this . suspended = false ; localTransactionContextInjectedValue . getValue ( ) . resumeRequests ( ) ; ServerActivityCallback listener = listenerUpdater . get ( this ) ; if ( listener != null ) { listenerUpdater . compareAndSet ( this , listener , null ) ; } deploymentRepositoryInjectedValue . getValue ( ) . resume ( ) ;


signature:
public class EJBSuspendHandlerService { /** * Indicates if a invocation should be accepted : which will happen only if server is not suspended , or if the invocation
 * involves a still active transaction .
 * @ param context interceptor context
 * @ return { @ code true } if invocation can be accepted by invoking interceptor */
public boolean acceptInvocation ( InterceptorContext context ) throws SystemException { } }

implementation:
if ( suspended ) { if ( ! gracefulTxnShutdown ) return false ; // a null listener means that we are done suspending ;
if ( listenerUpdater . get ( this ) == null || activeTransactionCountUpdater . get ( this ) == 0 ) return false ; // retrieve attachment only when we are not entirely suspended , meaning we are mid - suspension
if ( ! context . hasTransaction ( ) ) { // all requests with no transaction must be rejected at this point
// we need also to block requests with new transactions , which is not being done here . Instead ,
// we are relying on a future call to getTransaction in the same thread , before the invocation is executed ;
// this call will throw an exception if the transaction is new , because this suspend handler
// has invoked clientTransactionContext . suspendRequests
return false ; } } activeInvocationCountUpdater . incrementAndGet ( this ) ; return true ;


signature:
public class EJBSuspendHandlerService { /** * Notifies handler that an active invocation is complete . */
public void invocationComplete ( ) { } }

implementation: int activeInvocations = activeInvocationCountUpdater . decrementAndGet ( this ) ; if ( suspended && activeInvocations == 0 && ( ! gracefulTxnShutdown || ( activeTransactionCountUpdater . get ( this ) == 0 ) ) ) { doneSuspended ( ) ; }


signature:
public class EJBSuspendHandlerService { /** * Notifies handler that a new transaction has been created . */
@ Override public void transactionCreated ( AbstractTransaction transaction , CreatedBy createdBy ) { } }

implementation:
activeTransactionCountUpdater . incrementAndGet ( this ) ; try { transaction . registerSynchronization ( this ) ; } catch ( RollbackException | IllegalStateException e ) { // it means the transaction is marked for rollback , or is prepared for commit , at this point we cannot register synchronization
decrementTransactionCount ( ) ; } catch ( SystemException e ) { decrementTransactionCount ( ) ; EjbLogger . ROOT_LOGGER . debug ( "Unexpected exception" , e ) ; throw new RuntimeException ( e ) ; }


signature:
public class EJBSuspendHandlerService { /** * Completes suspension : stop deployment controller . */
private void doneSuspended ( ) { } }

implementation: final ServerActivityCallback oldListener = listener ; if ( oldListener != null && listenerUpdater . compareAndSet ( this , oldListener , null ) ) { deploymentRepositoryInjectedValue . getValue ( ) . suspend ( ) ; oldListener . done ( ) ; EjbLogger . ROOT_LOGGER . suspensionComplete ( ) ; }


signature:
public class BinderService { /** * Releases the service , returns < code > true < / code > if the service is removed as a result , or false otherwise
 * @ return */
public boolean release ( ) { } }

implementation: if ( refcnt != null && refcnt . decrementAndGet ( ) <= 0 && controller != null ) { controller . setMode ( ServiceController . Mode . REMOVE ) ; return true ; } return false ;


signature:
public class BinderService { /** * Bind the entry into the injected context .
 * @ param context The start context
 * @ throws StartException If the entity can not be bound */
public void start ( StartContext context ) throws StartException { } }

implementation: final ServiceBasedNamingStore namingStore = namingStoreValue . getValue ( ) ; controller = context . getController ( ) ; namingStore . add ( controller . getName ( ) ) ; ROOT_LOGGER . tracef ( "Bound resource %s into naming store %s (service name %s)" , name , namingStore , controller . getName ( ) ) ;


signature:
public class BinderService { /** * Unbind the entry from the injected context .
 * @ param context The stop context */
public void stop ( StopContext context ) { } }

implementation: final ServiceBasedNamingStore namingStore = namingStoreValue . getValue ( ) ; namingStore . remove ( controller . getName ( ) ) ; ROOT_LOGGER . tracef ( "Unbound resource %s into naming store %s (service name %s)" , name , namingStore , context . getController ( ) . getName ( ) ) ;


signature:
public class MessagingServices { /** * Determines a ServiceName from a capability name . Only supported for use by services installed by
 * this subsystem ; will not function reliably until the subsystem has begun adding runtime services .
 * @ param capabilityBaseName the base name of the capability , or its full name if it is not dynamic
 * @ param dynamicParts any dynamic parts of the capability name . May be { @ code null }
 * @ return the service name
 * @ throws IllegalStateException if invoked before the subsystem has begun adding runtime services */
public static ServiceName getCapabilityServiceName ( String capabilityBaseName , String ... dynamicParts ) { } }

implementation: if ( capabilityServiceSupport == null ) { throw new IllegalStateException ( ) ; } if ( dynamicParts == null || dynamicParts . length == 0 ) { return capabilityServiceSupport . getCapabilityServiceName ( capabilityBaseName ) ; } return capabilityServiceSupport . getCapabilityServiceName ( capabilityBaseName , dynamicParts ) ;


signature:
public class WarStructureDeploymentProcessor { /** * Create the resource roots for a . war deployment
 * @ param deploymentRoot the deployment root
 * @ return the resource roots
 * @ throws java . io . IOException for any error */
private List < ResourceRoot > createResourceRoots ( final VirtualFile deploymentRoot , final DeploymentUnit deploymentUnit ) throws IOException , DeploymentUnitProcessingException { } }

implementation:
final List < ResourceRoot > entries = new ArrayList < ResourceRoot > ( ) ; // WEB - INF classes
final VirtualFile webinfClasses = deploymentRoot . getChild ( WEB_INF_CLASSES ) ; if ( webinfClasses . exists ( ) ) { final ResourceRoot webInfClassesRoot = new ResourceRoot ( webinfClasses . getName ( ) , webinfClasses , null ) ; ModuleRootMarker . mark ( webInfClassesRoot ) ; entries . add ( webInfClassesRoot ) ; } // WEB - INF lib
Map < String , MountedDeploymentOverlay > overlays = deploymentUnit . getAttachment ( Attachments . DEPLOYMENT_OVERLAY_LOCATIONS ) ; final VirtualFile webinfLib = deploymentRoot . getChild ( WEB_INF_LIB ) ; if ( webinfLib . exists ( ) ) { final List < VirtualFile > archives = webinfLib . getChildren ( DEFAULT_WEB_INF_LIB_FILTER ) ; for ( final VirtualFile archive : archives ) { try { String relativeName = archive . getPathNameRelativeTo ( deploymentRoot ) ; MountedDeploymentOverlay overlay = overlays . get ( relativeName ) ; Closeable closable = null ; if ( overlay != null ) { overlay . remountAsZip ( false ) ; } else if ( archive . isFile ( ) ) { closable = VFS . mountZip ( archive , archive , TempFileProviderService . provider ( ) ) ; } else { closable = null ; } final ResourceRoot webInfArchiveRoot = new ResourceRoot ( archive . getName ( ) , archive , new MountHandle ( closable ) ) ; ModuleRootMarker . mark ( webInfArchiveRoot ) ; entries . add ( webInfArchiveRoot ) ; } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( UndertowLogger . ROOT_LOGGER . failToProcessWebInfLib ( archive ) , e ) ; } } } return entries ;


signature:
public class NamingExtension { /** * { @ inheritDoc } */
@ Override public void initialize ( ExtensionContext context ) { } }

implementation: final SubsystemRegistration subsystem = context . registerSubsystem ( SUBSYSTEM_NAME , CURRENT_MODEL_VERSION ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( new NamingSubsystemRootResourceDefinition ( ) ) ; registration . registerOperationHandler ( GenericSubsystemDescribeHandler . DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ; registration . registerSubModel ( NamingBindingResourceDefinition . INSTANCE ) ; registration . registerSubModel ( RemoteNamingResourceDefinition . INSTANCE ) ; if ( context . isRuntimeOnlyRegistrationValid ( ) ) { registration . registerOperationHandler ( NamingSubsystemRootResourceDefinition . JNDI_VIEW , JndiViewOperation . INSTANCE , false ) ; } subsystem . registerXMLElementWriter ( NamingSubsystemXMLPersister . INSTANCE ) ;


signature:
public class NamingExtension { /** * { @ inheritDoc } */
@ Override public void initializeParsers ( ExtensionParsingContext context ) { } }

implementation: context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_0 , ( ) -> new NamingSubsystem10Parser ( context . getProcessType ( ) == ProcessType . APPLICATION_CLIENT ) ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_1 , NamingSubsystem11Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_2 , NamingSubsystem12Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_3 , NamingSubsystem13Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_4 , NamingSubsystem14Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_2_0 , NamingSubsystem20Parser :: new ) ;


signature:
public class AbstractEntityManager { /** * used by TransactionScopedEntityManager to detach entities loaded by a query in a non - jta invocation . */
protected Query detachQueryNonTxInvocation ( EntityManager underlyingEntityManager , Query underLyingQuery ) { } }

implementation: if ( ! this . isExtendedPersistenceContext ( ) && ! this . isInTx ( ) ) { return new QueryNonTxInvocationDetacher ( underlyingEntityManager , underLyingQuery ) ; } return underLyingQuery ;


signature:
public class AbstractEntityManager { /** * used by TransactionScopedEntityManager to detach entities loaded by a query in a non - jta invocation . */
protected < T > TypedQuery < T > detachTypedQueryNonTxInvocation ( EntityManager underlyingEntityManager , TypedQuery < T > underLyingQuery ) { } }

implementation: if ( ! this . isExtendedPersistenceContext ( ) && ! this . isInTx ( ) ) { return new TypedQueryNonTxInvocationDetacher < > ( underlyingEntityManager , underLyingQuery ) ; } return underLyingQuery ;


signature:
public class PrimitiveDefImpl { /** * LocalIRObject implementation - - - - - */
public IRObject getReference ( ) { } }

implementation: if ( ref == null ) { ref = org . omg . CORBA . PrimitiveDefHelper . narrow ( servantToReference ( new PrimitiveDefPOATie ( this ) ) ) ; } return ref ;


signature:
public class JaxrsExtension { /** * { @ inheritDoc } */
@ Override public void initialize ( final ExtensionContext context ) { } }

implementation: JAXRS_LOGGER . debug ( "Activating JAX-RS Extension" ) ; final SubsystemRegistration subsystem = context . registerSubsystem ( SUBSYSTEM_NAME , CURRENT_MODEL_VERSION ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( JaxrsSubsystemDefinition . INSTANCE ) ; registration . registerOperationHandler ( GenericSubsystemDescribeHandler . DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ; ManagementResourceRegistration jaxrsResReg = subsystem . registerDeploymentModel ( JaxrsDeploymentDefinition . INSTANCE ) ; jaxrsResReg . registerSubModel ( DeploymentRestResourcesDefintion . INSTANCE ) ; subsystem . registerXMLElementWriter ( parser ) ;


signature:
public class JaxrsExtension { /** * { @ inheritDoc } */
@ Override public void initializeParsers ( final ExtensionParsingContext context ) { } }

implementation: context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , JaxrsExtension . NAMESPACE , ( ) -> parser ) ;


signature:
public class BusinessViewAnnotationProcessor { /** * Processes the session bean for remote and local views and updates the { @ link SessionBeanComponentDescription }
 * accordingly
 * @ param deploymentUnit The deployment unit
 * @ param sessionBeanClass The bean class
 * @ param sessionBeanComponentDescription
 * The component description
 * @ throws DeploymentUnitProcessingException */
private void processViewAnnotations ( final DeploymentUnit deploymentUnit , final Class < ? > sessionBeanClass , final SessionBeanComponentDescription sessionBeanComponentDescription ) throws DeploymentUnitProcessingException { } }

implementation:
final Collection < Class < ? > > remoteBusinessInterfaces = this . getRemoteBusinessInterfaces ( deploymentUnit , sessionBeanClass ) ; if ( remoteBusinessInterfaces != null && ! remoteBusinessInterfaces . isEmpty ( ) ) { sessionBeanComponentDescription . addRemoteBusinessInterfaceViews ( this . toString ( remoteBusinessInterfaces ) ) ; } // fetch the local business interfaces of the bean
Collection < Class < ? > > localBusinessInterfaces = this . getLocalBusinessInterfaces ( deploymentUnit , sessionBeanClass ) ; if ( localBusinessInterfaces != null && ! localBusinessInterfaces . isEmpty ( ) ) { sessionBeanComponentDescription . addLocalBusinessInterfaceViews ( this . toString ( localBusinessInterfaces ) ) ; } if ( hasNoInterfaceView ( sessionBeanClass ) ) { sessionBeanComponentDescription . addNoInterfaceView ( ) ; } // EJB 3.1 FR 4.9.7 & 4.9.8 , if the bean exposes no views
if ( hasNoViews ( sessionBeanComponentDescription ) ) { final Set < Class < ? > > potentialBusinessInterfaces = getPotentialBusinessInterfaces ( sessionBeanClass ) ; if ( potentialBusinessInterfaces . isEmpty ( ) ) { sessionBeanComponentDescription . addNoInterfaceView ( ) ; } else if ( potentialBusinessInterfaces . size ( ) == 1 ) { sessionBeanComponentDescription . addLocalBusinessInterfaceViews ( potentialBusinessInterfaces . iterator ( ) . next ( ) . getName ( ) ) ; } else if ( isEjbVersionGreaterThanOrEqualTo32 ( deploymentUnit ) ) { // EJB 3.2 spec states ( section 4.9.7 ) :
// . . . or if the bean class is annotated with neither the Local nor the Remote annotation , all implemented interfaces ( excluding the interfaces listed above )
// are assumed to be local business interfaces of the bean
sessionBeanComponentDescription . addLocalBusinessInterfaceViews ( toString ( potentialBusinessInterfaces ) ) ; } }


signature:
public class AbstractComponentConfigProcessor { /** * { @ inheritDoc } * */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation: final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( Attachments . EE_MODULE_DESCRIPTION ) ; final Collection < ComponentDescription > componentConfigurations = eeModuleDescription . getComponentDescriptions ( ) ; if ( componentConfigurations == null || componentConfigurations . isEmpty ( ) ) { return ; } for ( ComponentDescription componentConfiguration : componentConfigurations ) { final CompositeIndex index = deploymentUnit . getAttachment ( org . jboss . as . server . deployment . Attachments . COMPOSITE_ANNOTATION_INDEX ) ; if ( index != null ) { processComponentConfig ( deploymentUnit , phaseContext , index , componentConfiguration ) ; } }


signature:
public class PersistenceProviderHandler { /** * returns the toplevel deployment module classloader and all subdeployment classloaders
 * @ param deploymentUnit
 * @ return */
private static Set < ClassLoader > allDeploymentModuleClassLoaders ( DeploymentUnit deploymentUnit ) { } }

implementation: Set < ClassLoader > deploymentClassLoaders = new HashSet < ClassLoader > ( ) ; final DeploymentUnit topDeploymentUnit = DeploymentUtils . getTopDeploymentUnit ( deploymentUnit ) ; final Module toplevelModule = topDeploymentUnit . getAttachment ( Attachments . MODULE ) ; if ( toplevelModule != null ) { deploymentClassLoaders . add ( toplevelModule . getClassLoader ( ) ) ; final List < DeploymentUnit > subDeployments = topDeploymentUnit . getAttachmentList ( Attachments . SUB_DEPLOYMENTS ) ; for ( DeploymentUnit subDeploymentUnit : subDeployments ) { final Module subDeploymentModule = subDeploymentUnit . getAttachment ( Attachments . MODULE ) ; if ( subDeploymentModule != null ) { deploymentClassLoaders . add ( subDeploymentModule . getClassLoader ( ) ) ; } } } return deploymentClassLoaders ;


signature:
public class Configuration { /** * Determine if class file transformer is needed for the specified persistence unit
 * if the persistence provider is Hibernate and use _ class _ enhancer is not true , don ' t need a class transformer .
 * for other persistence providers , the transformer is assumed to be needed .
 * @ param pu the PU
 * @ return true if class file transformer support is needed for pu */
public static boolean needClassFileTransformer ( PersistenceUnitMetadata pu ) { } }

implementation: boolean result = true ; String provider = pu . getPersistenceProviderClassName ( ) ; if ( pu . getProperties ( ) . containsKey ( Configuration . JPA_CONTAINER_CLASS_TRANSFORMER ) ) { result = Boolean . parseBoolean ( pu . getProperties ( ) . getProperty ( Configuration . JPA_CONTAINER_CLASS_TRANSFORMER ) ) ; } else if ( isHibernateProvider ( provider ) ) { result = ( Boolean . TRUE . toString ( ) . equals ( pu . getProperties ( ) . getProperty ( HIBERNATE_USE_CLASS_ENHANCER ) ) || Boolean . TRUE . toString ( ) . equals ( pu . getProperties ( ) . getProperty ( HIBERNATE_ENABLE_DIRTY_TRACKING ) ) || Boolean . TRUE . toString ( ) . equals ( pu . getProperties ( ) . getProperty ( HIBERNATE_ENABLE_LAZY_INITIALIZATION ) ) || Boolean . TRUE . toString ( ) . equals ( pu . getProperties ( ) . getProperty ( HIBERNATE_ENABLE_ASSOCIATION_MANAGEMENT ) ) ) ; } return result ;


signature:
public class Configuration { /** * Determine if two phase persistence unit start is allowed
 * @ param pu
 * @ return */
public static boolean allowTwoPhaseBootstrap ( PersistenceUnitMetadata pu ) { } }

implementation: boolean result = true ; if ( EE_DEFAULT_DATASOURCE . equals ( pu . getJtaDataSourceName ( ) ) ) { result = false ; } if ( pu . getProperties ( ) . containsKey ( Configuration . JPA_ALLOW_TWO_PHASE_BOOTSTRAP ) ) { result = Boolean . parseBoolean ( pu . getProperties ( ) . getProperty ( Configuration . JPA_ALLOW_TWO_PHASE_BOOTSTRAP ) ) ; } return result ;


signature:
public class Configuration { /** * Determine if the default data - source should be used
 * @ param pu
 * @ return true if the default data - source should be used */
public static boolean allowDefaultDataSourceUse ( PersistenceUnitMetadata pu ) { } }

implementation: boolean result = true ; if ( pu . getProperties ( ) . containsKey ( Configuration . JPA_ALLOW_DEFAULT_DATA_SOURCE_USE ) ) { result = Boolean . parseBoolean ( pu . getProperties ( ) . getProperty ( Configuration . JPA_ALLOW_DEFAULT_DATA_SOURCE_USE ) ) ; } return result ;


signature:
public class Configuration { /** * Return true if detaching of managed entities should be deferred until the entity manager is closed .
 * Note : only applies to transaction scoped entity managers used without an active JTA transaction .
 * @ param properties
 * @ return */
public static boolean deferEntityDetachUntilClose ( final Map < String , Object > properties ) { } }

implementation: boolean result = false ; if ( properties . containsKey ( JPA_DEFER_DETACH ) ) result = Boolean . parseBoolean ( ( String ) properties . get ( JPA_DEFER_DETACH ) ) ; return result ;