signature:
public class ExternalPooledConnectionFactoryDefinition { /** * the regular and pooled CF */
private static ConnectionFactoryAttribute [ ] define ( ConnectionFactoryAttribute [ ] specific , ConnectionFactoryAttribute ... common ) { } }

implementation:
int size = common . length + specific . length ; ConnectionFactoryAttribute [ ] result = new ConnectionFactoryAttribute [ size ] ; for ( int i = 0 ; i < specific . length ; i ++ ) { ConnectionFactoryAttribute attr = specific [ i ] ; AttributeDefinition definition = attr . getDefinition ( ) ; if ( definition == ConnectionFactoryAttributes . Pooled . INITIAL_CONNECT_ATTEMPTS ) { result [ i ] = ConnectionFactoryAttribute . create ( SimpleAttributeDefinitionBuilder . create ( ConnectionFactoryAttributes . Pooled . INITIAL_CONNECT_ATTEMPTS ) . setDefaultValue ( new ModelNode ( - 1 ) ) . build ( ) , attr . getPropertyName ( ) , true ) ; } else { result [ i ] = attr ; } } for ( int i = 0 ; i < common . length ; i ++ ) { ConnectionFactoryAttribute attr = common [ i ] ; AttributeDefinition definition = attr . getDefinition ( ) ; ConnectionFactoryAttribute newAttr ; // replace the reconnect - attempts attribute to use a different default value for pooled CF
if ( definition == Common . RECONNECT_ATTEMPTS ) { AttributeDefinition copy = copy ( Pooled . RECONNECT_ATTEMPTS , AttributeAccess . Flag . RESTART_ALL_SERVICES ) ; newAttr = ConnectionFactoryAttribute . create ( copy , Pooled . RECONNECT_ATTEMPTS_PROP_NAME , true ) ; } else if ( definition == CommonAttributes . HA ) { newAttr = ConnectionFactoryAttribute . create ( SimpleAttributeDefinitionBuilder . create ( CommonAttributes . HA ) . setDefaultValue ( ModelNode . TRUE ) . setFlags ( AttributeAccess . Flag . RESTART_ALL_SERVICES ) . build ( ) , attr . getPropertyName ( ) , true ) ; } else if ( definition == Common . CONNECTORS ) { StringListAttributeDefinition copy = new StringListAttributeDefinition . Builder ( Common . CONNECTORS ) . setAlternatives ( CommonAttributes . DISCOVERY_GROUP ) . setRequired ( true ) . setAttributeParser ( AttributeParser . STRING_LIST ) . setAttributeMarshaller ( AttributeMarshaller . STRING_LIST ) . setCapabilityReference ( new AbstractTransportDefinition . TransportCapabilityReferenceRecorder ( CAPABILITY_NAME , CONNECTOR_CAPABILITY_NAME , true ) ) . setRestartAllServices ( ) . build ( ) ; newAttr = ConnectionFactoryAttribute . create ( copy , attr . getPropertyName ( ) , attr . isResourceAdapterProperty ( ) , attr . getConfigType ( ) ) ; } else { AttributeDefinition copy = copy ( definition , AttributeAccess . Flag . RESTART_ALL_SERVICES ) ; newAttr = ConnectionFactoryAttribute . create ( copy , attr . getPropertyName ( ) , attr . isResourceAdapterProperty ( ) , attr . getConfigType ( ) ) ; } result [ specific . length + i ] = newAttr ; } return result ;


signature:
public class DescriptorUtils { /** * returns an array of String representations of the parameter types . Primitives are returned as their native
 * representations , while classes are returned in the internal descriptor form e . g . Ljava / lang / Integer ; */
public static String [ ] parameterDescriptors ( String methodDescriptor ) { } }

implementation:
int i = 1 ; // char 0 is a ' ( '
List < String > ret = new ArrayList < String > ( ) ; int arrayStart = - 1 ; while ( methodDescriptor . charAt ( i ) != ')' ) { String type = null ; if ( methodDescriptor . charAt ( i ) == '[' ) { if ( arrayStart == - 1 ) { arrayStart = i ; } } else { if ( methodDescriptor . charAt ( i ) == 'L' ) { int start = i ; i ++ ; while ( methodDescriptor . charAt ( i ) != ';' ) { ++ i ; } if ( arrayStart == - 1 ) { type = methodDescriptor . substring ( start , i ) ; } else { type = methodDescriptor . substring ( arrayStart , i ) ; } } else { if ( arrayStart == - 1 ) { type = methodDescriptor . charAt ( i ) + "" ; } else { type = methodDescriptor . substring ( arrayStart , i + 1 ) ; } } arrayStart = - 1 ; ret . add ( type ) ; } ++ i ; } String [ ] r = new String [ ret . size ( ) ] ; for ( int j = 0 ; j < ret . size ( ) ; ++ j ) { r [ j ] = ret . get ( j ) ; } return r ;


signature:
public class DescriptorUtils { /** * performs basic validation on a descriptor */
public static String validateDescriptor ( String descriptor ) { } }

implementation: if ( descriptor . length ( ) == 0 ) { throw EeLogger . ROOT_LOGGER . cannotBeEmpty ( "descriptors" ) ; } if ( descriptor . length ( ) > 1 ) { if ( descriptor . startsWith ( "L" ) ) { if ( ! descriptor . endsWith ( ";" ) ) { throw EeLogger . ROOT_LOGGER . invalidDescriptor ( descriptor ) ; } } else if ( descriptor . startsWith ( "[" ) ) { } else { throw EeLogger . ROOT_LOGGER . invalidDescriptor ( descriptor ) ; } } else { char type = descriptor . charAt ( 0 ) ; switch ( type ) { case 'I' : case 'Z' : case 'S' : case 'B' : case 'F' : case 'D' : case 'V' : case 'J' : case 'C' : break ; default : throw EeLogger . ROOT_LOGGER . invalidDescriptor ( descriptor ) ; } } return descriptor ;


signature:
public class ParsedKernelDeploymentProcessor { /** * Process a deployment for KernelDeployment configuration .
 * Will install a { @ code POJO } for each configured bean .
 * @ param phaseContext the deployment unit context
 * @ throws DeploymentUnitProcessingException */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation:
final DeploymentUnit unit = phaseContext . getDeploymentUnit ( ) ; final List < KernelDeploymentXmlDescriptor > kdXmlDescriptors = unit . getAttachment ( KernelDeploymentXmlDescriptor . ATTACHMENT_KEY ) ; if ( kdXmlDescriptors == null || kdXmlDescriptors . isEmpty ( ) ) return ; final Module module = unit . getAttachment ( Attachments . MODULE ) ; if ( module == null ) throw PojoLogger . ROOT_LOGGER . noModuleFound ( unit ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final DeploymentReflectionIndex index = unit . getAttachment ( Attachments . REFLECTION_INDEX ) ; if ( index == null ) throw PojoLogger . ROOT_LOGGER . missingReflectionIndex ( unit ) ; for ( KernelDeploymentXmlDescriptor kdXmlDescriptor : kdXmlDescriptors ) { final List < BeanMetaDataConfig > beanConfigs = kdXmlDescriptor . getBeans ( ) ; for ( final BeanMetaDataConfig beanConfig : beanConfigs ) { describeBean ( module , serviceTarget , index , beanConfig ) ; } // TODO - - KD : : classloader , KD : : aliases
}


signature:
public class ViewManagedReferenceFactory { /** * { @ inheritDoc } */
public ManagedReference getReference ( ) { } }

implementation: try { return view . createInstance ( ) ; } catch ( Exception e ) { throw EeLogger . ROOT_LOGGER . componentViewConstructionFailure ( e ) ; }


signature:
public class WebMetaDataCreator { /** * Creates web meta data for EJB deployments .
 * @ param dep webservice deployment */
void create ( final Deployment dep ) { } }

implementation: final DeploymentUnit unit = WSHelper . getRequiredAttachment ( dep , DeploymentUnit . class ) ; WarMetaData warMD = ASHelper . getOptionalAttachment ( unit , WarMetaData . ATTACHMENT_KEY ) ; JBossWebMetaData jbossWebMD = warMD != null ? warMD . getMergedJBossWebMetaData ( ) : null ; if ( warMD == null ) { warMD = new WarMetaData ( ) ; } if ( jbossWebMD == null ) { jbossWebMD = new JBossWebMetaData ( ) ; warMD . setMergedJBossWebMetaData ( jbossWebMD ) ; unit . putAttachment ( WarMetaData . ATTACHMENT_KEY , warMD ) ; } createWebAppDescriptor ( dep , jbossWebMD ) ; createJBossWebAppDescriptor ( dep , jbossWebMD ) ; dep . addAttachment ( JBossWebMetaData . class , jbossWebMD ) ;


signature:
public class WebMetaDataCreator { /** * Creates web . xml descriptor meta data .
 * @ param dep webservice deployment
 * @ param jbossWebMD jboss web meta data */
private void createWebAppDescriptor ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation: WSLogger . ROOT_LOGGER . trace ( "Creating web.xml descriptor" ) ; createServlets ( dep , jbossWebMD ) ; createServletMappings ( dep , jbossWebMD ) ; createSecurityConstraints ( dep , jbossWebMD ) ; createLoginConfig ( dep , jbossWebMD ) ; createSecurityRoles ( dep , jbossWebMD ) ;


signature:
public class WebMetaDataCreator { /** * Creates jboss - web . xml descriptor meta data .
 * < pre >
 * & lt ; jboss - web & gt ;
 * & lt ; security - domain & gt ; java : / jaas / custom - security - domain & lt ; / security - domain & gt ;
 * & lt ; context - root & gt ; / custom - context - root & lt ; / context - root & gt ;
 * & lt ; virtual - host & gt ; host1 & lt ; / virtual - host & gt ;
 * & lt ; virtual - host & gt ; hostN & lt ; / virtual - host & gt ;
 * & lt ; / jboss - web & gt ;
 * < / pre >
 * @ param dep webservice deployment
 * @ param jbossWebMD jboss web meta data */
private void createJBossWebAppDescriptor ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation:
WSLogger . ROOT_LOGGER . trace ( "Creating jboss-web.xml descriptor" ) ; // Set security domain
final String securityDomain = ejb3SecurityAccessor . getSecurityDomain ( dep ) ; final boolean hasSecurityDomain = securityDomain != null ; if ( hasSecurityDomain ) { WSLogger . ROOT_LOGGER . tracef ( "Setting security domain: %s" , securityDomain ) ; jbossWebMD . setSecurityDomain ( securityDomain ) ; } // Set virtual host
final String virtualHost = dep . getService ( ) . getVirtualHost ( ) ; ServerHostInfo serverHostInfo = new ServerHostInfo ( virtualHost ) ; if ( serverHostInfo . getHost ( ) != null ) { WSLogger . ROOT_LOGGER . tracef ( "Setting virtual host: %s" , serverHostInfo . getHost ( ) ) ; jbossWebMD . setVirtualHosts ( Arrays . asList ( serverHostInfo . getHost ( ) ) ) ; if ( serverHostInfo . getServerInstanceName ( ) != null ) { jbossWebMD . setServerInstanceName ( serverHostInfo . getServerInstanceName ( ) ) ; } }


signature:
public class WebMetaDataCreator { /** * Creates servlets part of web . xml descriptor .
 * < pre >
 * & lt ; servlet & gt ;
 * & lt ; servlet - name & gt ; EJBEndpointShortName & lt ; / servlet - name & gt ;
 * & lt ; servlet - class & gt ; EJBEndpointTargetBeanName & lt ; / servlet - class & gt ;
 * & lt ; / servlet & gt ;
 * < / pre >
 * @ param dep webservice deployment
 * @ param jbossWebMD jboss web meta data */
private void createServlets ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation: WSLogger . ROOT_LOGGER . trace ( "Creating servlets" ) ; final JBossServletsMetaData servlets = WebMetaDataHelper . getServlets ( jbossWebMD ) ; for ( final Endpoint endpoint : dep . getService ( ) . getEndpoints ( ) ) { final String endpointName = endpoint . getShortName ( ) ; final String endpointClassName = endpoint . getTargetBeanName ( ) ; WSLogger . ROOT_LOGGER . tracef ( "Servlet name: %s, class: %s" , endpointName , endpointClassName ) ; WebMetaDataHelper . newServlet ( endpointName , endpointClassName , servlets ) ; }


signature:
public class WebMetaDataCreator { /** * Creates servlet - mapping part of web . xml descriptor .
 * < pre >
 * & lt ; servlet - mapping & gt ;
 * & lt ; servlet - name & gt ; EJBEndpointShortName & lt ; / servlet - name & gt ;
 * & lt ; url - pattern & gt ; EJBEndpointURLPattern & lt ; / url - pattern & gt ;
 * & lt ; / servlet - mapping & gt ;
 * < / pre >
 * @ param dep webservice deployment
 * @ param jbossWebMD jboss web meta data */
private void createServletMappings ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation: WSLogger . ROOT_LOGGER . trace ( "Creating servlet mappings" ) ; final List < ServletMappingMetaData > servletMappings = WebMetaDataHelper . getServletMappings ( jbossWebMD ) ; for ( final Endpoint ep : dep . getService ( ) . getEndpoints ( ) ) { if ( ep instanceof HttpEndpoint ) { final String endpointName = ep . getShortName ( ) ; final List < String > urlPatterns = WebMetaDataHelper . getUrlPatterns ( ( ( HttpEndpoint ) ep ) . getURLPattern ( ) ) ; WSLogger . ROOT_LOGGER . tracef ( "Servlet name: %s, URL patterns: %s" , endpointName , urlPatterns ) ; WebMetaDataHelper . newServletMapping ( endpointName , urlPatterns , servletMappings ) ; } }


signature:
public class WebMetaDataCreator { /** * Creates security constraints part of web . xml descriptor .
 * < pre >
 * & lt ; security - constraint & gt ;
 * & lt ; web - resource - collection & gt ;
 * & lt ; web - resource - name & gt ; EJBEndpointShortName & lt ; / web - resource - name & gt ;
 * & lt ; url - pattern & gt ; EJBEndpointURLPattern & lt ; / url - pattern & gt ;
 * & lt ; http - method & gt ; GET & lt ; / http - method & gt ;
 * & lt ; http - method & gt ; POST & lt ; / http - method & gt ;
 * & lt ; / web - resource - collection & gt ;
 * & lt ; auth - constraint & gt ;
 * & lt ; role - name & gt ; * & lt ; / role - name & gt ;
 * & lt ; / auth - constraint & gt ;
 * & lt ; user - data - constraint & gt ;
 * & lt ; transport - guarantee & gt ; EjbTransportGuarantee & lt ; / transport - guarantee & gt ;
 * & lt ; / user - data - constraint & gt ;
 * & lt ; / security - constraint & gt ;
 * < / pre >
 * @ param dep webservice deployment
 * @ param jbossWebMD jboss web meta data */
private void createSecurityConstraints ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation:
WSLogger . ROOT_LOGGER . trace ( "Creating security constraints" ) ; for ( final Endpoint ejbEndpoint : dep . getService ( ) . getEndpoints ( ) ) { final boolean secureWsdlAccess = ejb3SecurityAccessor . isSecureWsdlAccess ( ejbEndpoint ) ; final String transportGuarantee = ejb3SecurityAccessor . getTransportGuarantee ( ejbEndpoint ) ; final boolean hasTransportGuarantee = transportGuarantee != null ; final String authMethod = ejb3SecurityAccessor . getAuthMethod ( ejbEndpoint ) ; final boolean hasAuthMethod = authMethod != null ; if ( ejbEndpoint instanceof HttpEndpoint && ( hasAuthMethod || hasTransportGuarantee ) ) { final List < SecurityConstraintMetaData > securityConstraints = WebMetaDataHelper . getSecurityConstraints ( jbossWebMD ) ; // security - constraint
final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper . newSecurityConstraint ( securityConstraints ) ; // web - resource - collection
final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper . getWebResourceCollections ( securityConstraint ) ; final String endpointName = ejbEndpoint . getShortName ( ) ; final String urlPattern = ( ( HttpEndpoint ) ejbEndpoint ) . getURLPattern ( ) ; WSLogger . ROOT_LOGGER . tracef ( "Creating web resource collection for endpoint: %s, URL pattern: %s" , endpointName , urlPattern ) ; WebMetaDataHelper . newWebResourceCollection ( endpointName , urlPattern , secureWsdlAccess , webResourceCollections ) ; // auth - constraint
if ( hasAuthMethod ) { WSLogger . ROOT_LOGGER . tracef ( "Creating auth constraint for endpoint: %s" , endpointName ) ; WebMetaDataHelper . newAuthConstraint ( WebMetaDataHelper . getAllRoles ( ) , securityConstraint ) ; } // user - data - constraint
if ( hasTransportGuarantee ) { WSLogger . ROOT_LOGGER . tracef ( "Creating new user data constraint for endpoint: %s, transport guarantee: %s" , endpointName , transportGuarantee ) ; WebMetaDataHelper . newUserDataConstraint ( transportGuarantee , securityConstraint ) ; } } }


signature:
public class WebMetaDataCreator { /** * Creates login - config part of web . xml descriptor .
 * < pre >
 * & lt ; login - config & gt ;
 * & lt ; auth - method & gt ; EjbDeploymentAuthMethod & lt ; / auth - method & gt ;
 * & lt ; realm - name & gt ; EJBWebServiceEndpointServlet Realm & lt ; / realm - name & gt ;
 * & lt ; / login - config & gt ;
 * < / pre >
 * @ param dep webservice deployment
 * @ param jbossWebMD jboss web meta data */
private void createLoginConfig ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation: final String authMethod = getAuthMethod ( dep ) ; final boolean hasAuthMethod = authMethod != null ; final String realmName = getRealmName ( dep ) ; if ( hasAuthMethod ) { WSLogger . ROOT_LOGGER . tracef ( "Creating new login config: %s, auth method: %s" , EJB_WEBSERVICE_REALM , authMethod ) ; final LoginConfigMetaData loginConfig = WebMetaDataHelper . getLoginConfig ( jbossWebMD ) ; if ( realmName != null ) { loginConfig . setRealmName ( realmName ) ; } else { loginConfig . setRealmName ( WebMetaDataCreator . EJB_WEBSERVICE_REALM ) ; } loginConfig . setAuthMethod ( authMethod ) ; }


signature:
public class WebMetaDataCreator { /** * Creates security roles part of web . xml descriptor .
 * < pre >
 * & lt ; security - role & gt ;
 * & lt ; role - name & gt ; role1 & lt ; / role - name & gt ;
 * & lt ; role - name & gt ; roleN & lt ; / role - name & gt ;
 * & lt ; / security - role & gt ;
 * < / pre >
 * @ param dep webservice deployment
 * @ param jbossWebMD jboss web meta data */
private void createSecurityRoles ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation:
final String authMethod = getAuthMethod ( dep ) ; final boolean hasAuthMethod = authMethod != null ; if ( hasAuthMethod ) { final SecurityRolesMetaData securityRolesMD = ejb3SecurityAccessor . getSecurityRoles ( dep ) ; final boolean hasSecurityRolesMD = securityRolesMD != null && ! securityRolesMD . isEmpty ( ) ; if ( hasSecurityRolesMD ) { WSLogger . ROOT_LOGGER . trace ( "Setting security roles" ) ; jbossWebMD . setSecurityRoles ( securityRolesMD ) ; } } // merge security roles from the ear
// TODO : is there somewhere better to put this ?
final DeploymentUnit unit = dep . getAttachment ( DeploymentUnit . class ) ; DeploymentUnit parent = unit . getParent ( ) ; if ( parent != null ) { final EarMetaData earMetaData = parent . getAttachment ( org . jboss . as . ee . structure . Attachments . EAR_METADATA ) ; if ( earMetaData != null ) { if ( jbossWebMD . getSecurityRoles ( ) == null ) { jbossWebMD . setSecurityRoles ( new SecurityRolesMetaData ( ) ) ; } SecurityRolesMetaData earSecurityRolesMetaData = earMetaData . getSecurityRoles ( ) ; if ( earSecurityRolesMetaData != null ) { SecurityRolesMetaDataMerger . merge ( jbossWebMD . getSecurityRoles ( ) , jbossWebMD . getSecurityRoles ( ) , earSecurityRolesMetaData ) ; } } }


signature:
public class WebMetaDataCreator { /** * Returns deployment authentication method .
 * @ param dep webservice deployment
 * @ return deployment authentication method */
private String getAuthMethod ( final Deployment dep ) { } }

implementation:
for ( final Endpoint ejbEndpoint : dep . getService ( ) . getEndpoints ( ) ) { final String beanAuthMethod = ejb3SecurityAccessor . getAuthMethod ( ejbEndpoint ) ; final boolean hasBeanAuthMethod = beanAuthMethod != null ; if ( hasBeanAuthMethod ) { // First found auth - method defines war
// login - config / auth - method
return beanAuthMethod ; } } return null ;


signature:
public class ServiceDeploymentParsingProcessor { /** * Process a deployment for jboss - service . xml files . Will parse the xml file and attach a configuration discovered
 * during processing .
 * @ param phaseContext the deployment unit context
 * @ throws DeploymentUnitProcessingException */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation: final VirtualFile deploymentRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( Attachments . DEPLOYMENT_ROOT ) . getRoot ( ) ; if ( deploymentRoot == null || ! deploymentRoot . exists ( ) ) return ; VirtualFile serviceXmlFile = null ; if ( deploymentRoot . isDirectory ( ) ) { serviceXmlFile = deploymentRoot . getChild ( SERVICE_DESCRIPTOR_PATH ) ; } else if ( deploymentRoot . getName ( ) . toLowerCase ( Locale . ENGLISH ) . endsWith ( SERVICE_DESCRIPTOR_SUFFIX ) ) { serviceXmlFile = deploymentRoot ; } if ( serviceXmlFile == null || ! serviceXmlFile . exists ( ) ) return ; final XMLMapper xmlMapper = XMLMapper . Factory . create ( ) ; final JBossServiceXmlDescriptorParser jBossServiceXmlDescriptorParser = new JBossServiceXmlDescriptorParser ( JBossDescriptorPropertyReplacement . propertyReplacer ( phaseContext . getDeploymentUnit ( ) ) ) ; xmlMapper . registerRootElement ( new QName ( "urn:jboss:service:7.0" , "server" ) , jBossServiceXmlDescriptorParser ) ; xmlMapper . registerRootElement ( new QName ( null , "server" ) , jBossServiceXmlDescriptorParser ) ; InputStream xmlStream = null ; try { xmlStream = serviceXmlFile . openStream ( ) ; final XMLStreamReader reader = inputFactory . createXMLStreamReader ( xmlStream ) ; final ParseResult < JBossServiceXmlDescriptor > result = new ParseResult < JBossServiceXmlDescriptor > ( ) ; xmlMapper . parseDocument ( result , reader ) ; final JBossServiceXmlDescriptor xmlDescriptor = result . getResult ( ) ; if ( xmlDescriptor != null ) phaseContext . getDeploymentUnit ( ) . putAttachment ( JBossServiceXmlDescriptor . ATTACHMENT_KEY , xmlDescriptor ) ; else throw SarLogger . ROOT_LOGGER . failedXmlParsing ( serviceXmlFile ) ; } catch ( Exception e ) { throw SarLogger . ROOT_LOGGER . failedXmlParsing ( e , serviceXmlFile ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; }


signature:
public class DeploymentDescriptorMethodProcessor { /** * Handles setting up the ejbCreate and ejbRemove methods for stateless session beans and MDB ' s
 * @ param component The component
 * @ param module The module
 * @ param reflectionIndex The reflection index */
private void handleStatelessSessionBean ( final EJBComponentDescription component , final Module module , final DeploymentReflectionIndex reflectionIndex ) throws ClassNotFoundException , DeploymentUnitProcessingException { } }

implementation: final Class < ? > componentClass = ClassLoadingUtils . loadClass ( component . getComponentClassName ( ) , module ) ; final MethodIdentifier ejbCreateId = MethodIdentifier . getIdentifier ( void . class , "ejbCreate" ) ; final Method ejbCreate = ClassReflectionIndexUtil . findMethod ( reflectionIndex , componentClass , ejbCreateId ) ; if ( ejbCreate != null ) { final InterceptorClassDescription . Builder builder = InterceptorClassDescription . builder ( ) ; builder . setPostConstruct ( ejbCreateId ) ; component . addInterceptorMethodOverride ( ejbCreate . getDeclaringClass ( ) . getName ( ) , builder . build ( ) ) ; } final MethodIdentifier ejbRemoveId = MethodIdentifier . getIdentifier ( void . class , "ejbRemove" ) ; final Method ejbRemove = ClassReflectionIndexUtil . findMethod ( reflectionIndex , componentClass , ejbRemoveId ) ; if ( ejbRemove != null ) { final InterceptorClassDescription . Builder builder = InterceptorClassDescription . builder ( ) ; builder . setPreDestroy ( ejbRemoveId ) ; component . addInterceptorMethodOverride ( ejbRemove . getDeclaringClass ( ) . getName ( ) , builder . build ( ) ) ; }


signature:
public class DynamicStubFactoryFactory { /** * Makes a dynamic stub class , if it does not already exist .
 * @ param myClass The class to create a stub for
 * @ return The dynamic stub class */
public static Class < ? > makeStubClass ( final Class < ? > myClass ) { } }

implementation:
final String stubClassName = myClass + "_Stub" ; ClassLoader cl = WildFlySecurityManager . getCurrentContextClassLoaderPrivileged ( ) ; if ( cl == null ) { cl = myClass . getClassLoader ( ) ; } if ( cl == null ) { throw EjbLogger . ROOT_LOGGER . couldNotFindClassLoaderForStub ( stubClassName ) ; } Class < ? > theClass ; try { theClass = cl . loadClass ( stubClassName ) ; } catch ( ClassNotFoundException e ) { try { final ClassFile clazz = IIOPStubCompiler . compile ( myClass , stubClassName ) ; theClass = clazz . define ( cl , myClass . getProtectionDomain ( ) ) ; } catch ( Throwable ex ) { // there is a possibility that another thread may have defined the same class in the meantime
try { theClass = cl . loadClass ( stubClassName ) ; } catch ( ClassNotFoundException e1 ) { EjbLogger . ROOT_LOGGER . dynamicStubCreationFailed ( stubClassName , ex ) ; throw ex ; } } } return theClass ;


signature:
public class RepositoryImpl { /** * Repository implementation - - - - - */
public Contained lookup_id ( java . lang . String search_id ) { } }

implementation: LocalContained c = _lookup_id ( search_id ) ; if ( c == null ) return null ; return ContainedHelper . narrow ( c . getReference ( ) ) ;


signature:
public class RepositoryImpl { /** * Generate the ID of the n - th " anonymous " object created in this IR . */
protected byte [ ] getAnonymousObjectId ( long n ) { } }

implementation: String s = anonOidPrefix + Long . toString ( n ) ; return s . getBytes ( StandardCharsets . UTF_8 ) ;


signature:
public class RepositoryImpl { /** * Convert a repository ID to an IDL scoped name .
 * Returns < code > null < / code > if the ID cannot be understood . */
private String scopedName ( String id ) { } }

implementation:
if ( id == null ) return null ; if ( id . startsWith ( "IDL:" ) ) { // OMG IDL format
// Check for base types
if ( "IDL:omg.org/CORBA/Object:1.0" . equals ( id ) || "IDL:omg.org/CORBA/ValueBase:1.0" . equals ( id ) ) return null ; // Get 2nd component of ID
int idx2 = id . indexOf ( ':' , 4 ) ; // 2nd colon
if ( idx2 == - 1 ) return null ; // invalid ID , version part missing
String base = id . substring ( 4 , id . indexOf ( ':' , 4 ) ) ; // Check special prefixes
if ( base . startsWith ( "omg.org" ) ) base = "org/omg" + base . substring ( 7 ) ; if ( base . startsWith ( "w3c.org" ) ) base = "org/w3c" + base . substring ( 7 ) ; // convert ' / ' to " : : "
StringBuffer b = new StringBuffer ( ) ; for ( int i = 0 ; i < base . length ( ) ; ++ i ) { char c = base . charAt ( i ) ; if ( c != '/' ) b . append ( c ) ; else b . append ( "::" ) ; } return b . toString ( ) ; } else if ( id . startsWith ( "RMI:" ) ) { // RMI hashed format
// Get 2nd component of ID
int idx2 = id . indexOf ( ':' , 4 ) ; // 2nd colon
if ( idx2 == - 1 ) return null ; // invalid ID , version part missing
String base = id . substring ( 4 , id . indexOf ( ':' , 4 ) ) ; // convert ' . ' to " : : "
StringBuffer b = new StringBuffer ( ) ; for ( int i = 0 ; i < base . length ( ) ; ++ i ) { char c = base . charAt ( i ) ; if ( c != '.' ) b . append ( c ) ; else b . append ( "::" ) ; } return b . toString ( ) ; } else return null ;


signature:
public class SimpleOperationTransformer { /** * { @ inheritDoc } */
@ Override public TransformedOperation transformOperation ( TransformationContext context , PathAddress address , ModelNode operation ) { } }

implementation: return new TransformedOperation ( this . operationTransformer . transformOperation ( operation ) , this . resultTransformer ) ;


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

implementation: WeldLogger . ROOT_LOGGER . debug ( "Activating Weld Extension" ) ; final SubsystemRegistration subsystem = context . registerSubsystem ( SUBSYSTEM_NAME , CURRENT_MODEL_VERSION ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( WeldResourceDefinition . INSTANCE ) ; registration . registerOperationHandler ( GenericSubsystemDescribeHandler . DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ; subsystem . registerXMLElementWriter ( WeldSubsystem40Parser . INSTANCE ) ;


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

implementation: context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , WeldSubsystem10Parser . NAMESPACE , ( ) -> WeldSubsystem10Parser . INSTANCE ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , WeldSubsystem20Parser . NAMESPACE , ( ) -> WeldSubsystem20Parser . INSTANCE ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , WeldSubsystem30Parser . NAMESPACE , ( ) -> WeldSubsystem30Parser . INSTANCE ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , WeldSubsystem40Parser . NAMESPACE , ( ) -> WeldSubsystem40Parser . INSTANCE ) ;


signature:
public class CreateDestroyService { /** * { @ inheritDoc } */
public void start ( final StartContext context ) { } }

implementation: super . start ( context ) ; if ( SarLogger . ROOT_LOGGER . isTraceEnabled ( ) ) { SarLogger . ROOT_LOGGER . tracef ( "Creating Service: %s" , context . getController ( ) . getName ( ) ) ; } final Runnable task = new Runnable ( ) { @ Override public void run ( ) { try { injectDependencies ( ) ; invokeLifecycleMethod ( createMethod , context ) ; if ( componentInstantiator != null ) { managedReference = componentInstantiator . initializeInstance ( mBeanInstance ) ; } context . complete ( ) ; } catch ( Throwable e ) { uninjectDependencies ( ) ; context . failed ( new StartException ( SarLogger . ROOT_LOGGER . failedExecutingLegacyMethod ( "create()" ) , e ) ) ; } } } ; try { executorSupplier . get ( ) . submit ( task ) ; } catch ( RejectedExecutionException e ) { task . run ( ) ; } finally { context . asynchronous ( ) ; }


signature:
public class SecurityDomainReloadWriteHandler { /** * TODO : Remove this method once WFCORE - 3055 and WFCORE - 3056 are fixed */
@ Override protected void validateUpdatedModel ( OperationContext context , Resource model ) throws OperationFailedException { } }

implementation: SecurityDomainResourceDefinition . CACHE_TYPE . validateOperation ( model . getModel ( ) ) ;


signature:
public class PredicateValidator { /** * { @ inheritDoc } */
@ Override public void validateParameter ( String parameterName , ModelNode value ) throws OperationFailedException { } }

implementation: super . validateParameter ( parameterName , value ) ; if ( value . isDefined ( ) && value . getType ( ) != ModelType . EXPRESSION ) { String val = value . asString ( ) ; try { PredicateParser . parse ( val , getClass ( ) . getClassLoader ( ) ) ; } catch ( Exception e ) { throw new OperationFailedException ( UndertowLogger . ROOT_LOGGER . predicateNotValid ( val , e . getMessage ( ) ) , e ) ; } }


signature:
public class PersistenceProviderResolverImpl { /** * Cleared at application undeployment time to remove any persistence providers that were deployed with the application
 * @ param deploymentClassLoaders */
public void clearCachedDeploymentSpecificProviders ( Set < ClassLoader > deploymentClassLoaders ) { } }

implementation: synchronized ( persistenceProviderPerClassLoader ) { for ( ClassLoader deploymentClassLoader : deploymentClassLoaders ) { persistenceProviderPerClassLoader . remove ( deploymentClassLoader ) ; } }


signature:
public class PersistenceProviderResolverImpl { /** * Set at application deployment time to the persistence providers packaged in the application
 * @ param persistenceProvider
 * @ param deploymentClassLoaders */
public void addDeploymentSpecificPersistenceProvider ( PersistenceProvider persistenceProvider , Set < ClassLoader > deploymentClassLoaders ) { } }

implementation: synchronized ( persistenceProviderPerClassLoader ) { for ( ClassLoader deploymentClassLoader : deploymentClassLoaders ) { List < Class < ? extends PersistenceProvider > > list = persistenceProviderPerClassLoader . get ( deploymentClassLoader ) ; ROOT_LOGGER . tracef ( "getting persistence provider list (%s) for deployment (%s)" , list , deploymentClassLoader ) ; if ( list == null ) { list = new ArrayList < > ( ) ; persistenceProviderPerClassLoader . put ( deploymentClassLoader , list ) ; ROOT_LOGGER . tracef ( "saving new persistence provider list (%s) for deployment (%s)" , list , deploymentClassLoader ) ; } list . add ( persistenceProvider . getClass ( ) ) ; ROOT_LOGGER . tracef ( "added new persistence provider (%s) to provider list (%s)" , persistenceProvider . getClass ( ) . getName ( ) , list ) ; } }


signature:
public class PersistenceProviderResolverImpl { /** * If a custom CL is in use we want to get the module CL it delegates to
 * @ param classLoader The current CL
 * @ returnThe corresponding module CL */
private ClassLoader findParentModuleCl ( ClassLoader classLoader ) { } }

implementation: ClassLoader c = classLoader ; while ( c != null && ! ( c instanceof ModuleClassLoader ) ) { c = c . getParent ( ) ; } return c ;


signature:
public class JacORBSubsystemParser { /** * Parses the JacORB subsystem configuration according to the XSD version 1.0.
 * @ param namespace the expected { @ code Namespace } of the parsed elements .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed subsystem configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void readElement_1_0 ( Namespace namespace , XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { // check the element namespace .
if ( Namespace . JacORB_1_0 != Namespace . forUri ( reader . getNamespaceURI ( ) ) ) throw unexpectedElement ( reader ) ; final Element element = Element . forName ( reader . getLocalName ( ) ) ; // there can be multiple property elements .
if ( ! encountered . add ( element ) && element != Element . PROPERTY ) { throw duplicateNamedElement ( reader , element . getLocalName ( ) ) ; } switch ( element ) { case ORB : { this . parseORBConfig_1_0 ( reader , node ) ; break ; } case POA : { this . parsePOAConfig ( namespace , reader , node ) ; break ; } case INTEROP : { this . parseInteropConfig ( reader , node ) ; break ; } case SECURITY : { this . parseSecurityConfig_1_0 ( reader , node ) ; break ; } case PROPERTY : { ModelNode propertiesNode = node . get ( JacORBSubsystemConstants . PROPERTIES ) ; this . parseGenericProperty_1_0 ( reader , propertiesNode ) ; break ; } case ORB_INITIALIZERS : { this . parseORBInitializersConfig_1_0 ( reader , node ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class JacORBSubsystemParser { /** * Parses the JacORB subsystem configuration according to the XSD version 1.1 or higher .
 * @ param namespace the expected { @ code Namespace } of the parsed elements .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed subsystem configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void readElement_1_1 ( Namespace namespace , XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { // check the element namespace .
if ( namespace != Namespace . forUri ( reader . getNamespaceURI ( ) ) ) throw unexpectedElement ( reader ) ; final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( ! encountered . add ( element ) ) { throw duplicateNamedElement ( reader , element . getLocalName ( ) ) ; } switch ( element ) { case ORB : { this . parseORBConfig ( namespace , reader , node ) ; break ; } case POA : { this . parsePOAConfig ( namespace , reader , node ) ; break ; } case NAMING : { this . parseNamingConfig ( reader , node ) ; break ; } case INTEROP : { this . parseInteropConfig ( reader , node ) ; break ; } case SECURITY : { this . parseSecurityConfig ( reader , node ) ; break ; } case PROPERTIES : { this . parsePropertiesConfig ( namespace , reader , node ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code orb } section of the JacORB subsystem configuration according to the XSD version 1.0.
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed ORB configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseORBConfig_1_0 ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse the orb config attributes .
EnumSet < Attribute > expectedAttributes = EnumSet . of ( Attribute . NAME , Attribute . ORB_PRINT_VERSION , Attribute . ORB_GIOP_MINOR_VERSION , Attribute . ORB_USE_BOM , Attribute . ORB_USE_IMR , Attribute . ORB_CACHE_POA_NAMES , Attribute . ORB_CACHE_TYPECODES ) ; this . parseAttributes ( reader , node , expectedAttributes , null ) ; // parse the orb config elements .
EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { // check the element namespace .
if ( Namespace . JacORB_1_0 != Namespace . forUri ( reader . getNamespaceURI ( ) ) ) throw unexpectedElement ( reader ) ; final Element element = Element . forName ( reader . getLocalName ( ) ) ; // check for duplicate elements .
if ( ! encountered . add ( element ) ) { throw duplicateNamedElement ( reader , element . getLocalName ( ) ) ; } switch ( element ) { case ORB_CONNECTION : { this . parseORBConnectionConfig ( reader , node ) ; break ; } case NAMING : { this . parseNamingConfig ( reader , node ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code orb } section of the JacORB subsystem configuration according to the XSD version 1.1 or higher .
 * @ param namespace the expected { @ code Namespace } of the parsed elements .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed ORB configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseORBConfig ( Namespace namespace , XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse the orb config attributes .
EnumSet < Attribute > expectedAttributes = EnumSet . of ( Attribute . NAME , Attribute . ORB_PRINT_VERSION , Attribute . ORB_GIOP_MINOR_VERSION , Attribute . ORB_USE_BOM , Attribute . ORB_USE_IMR , Attribute . ORB_CACHE_POA_NAMES , Attribute . ORB_CACHE_TYPECODES ) ; // version 1.2 of the schema allows for the configuration of the ORB socket bindings .
if ( namespace . ordinal ( ) >= Namespace . JacORB_1_2 . ordinal ( ) ) { expectedAttributes . add ( Attribute . ORB_SOCKET_BINDING ) ; expectedAttributes . add ( Attribute . ORB_SSL_SOCKET_BINDING ) ; } if ( namespace . ordinal ( ) >= Namespace . JacORB_2_0 . ordinal ( ) ) { expectedAttributes . add ( Attribute . ORB_PERSISTENT_SERVER_ID ) ; } this . parseAttributes ( reader , node , expectedAttributes , null ) ; // parse the orb config elements .
EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { // check the element namespace .
if ( namespace != Namespace . forUri ( reader . getNamespaceURI ( ) ) ) throw unexpectedElement ( reader ) ; final Element element = Element . forName ( reader . getLocalName ( ) ) ; // check for duplicate elements .
if ( ! encountered . add ( element ) ) { throw duplicateNamedElement ( reader , element . getLocalName ( ) ) ; } switch ( element ) { case ORB_CONNECTION : { this . parseORBConnectionConfig ( reader , node ) ; break ; } case ORB_INITIALIZERS : { this . parseORBInitializersConfig ( reader , node ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class JacORBSubsystemParser { /** * Parses the ORB { @ code connection } section of the JacORB subsystem configuration .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed ORB connection configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseORBConnectionConfig ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse the orb connection config attributes .
EnumSet < Attribute > attributes = EnumSet . of ( Attribute . ORB_CONN_RETRIES , Attribute . ORB_CONN_RETRY_INTERVAL , Attribute . ORB_CONN_CLIENT_TIMEOUT , Attribute . ORB_CONN_SERVER_TIMEOUT , Attribute . ORB_CONN_MAX_SERVER_CONNECTIONS , Attribute . ORB_CONN_MAX_MANAGED_BUF_SIZE , Attribute . ORB_CONN_OUTBUF_SIZE , Attribute . ORB_CONN_OUTBUF_CACHE_TIMEOUT ) ; this . parseAttributes ( reader , node , attributes , null ) ; // the connection sub - element doesn ' t have child elements .
requireNoContent ( reader ) ;


signature:
public class JacORBSubsystemParser { /** * Parses the ORB { @ code initializers } section of the JacORB subsystem configuration according to the XSD version 1.0.
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed ORB initializers configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseORBInitializersConfig_1_0 ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
requireNoAttributes ( reader ) ; // read the element text - a comma - separated list of initializers .
String initializersList = reader . getElementText ( ) ; if ( initializersList != null ) { String [ ] initializers = initializersList . split ( "," ) ; // read each configured initializer and set the appropriate values in the model node .
for ( String initializer : initializers ) { SimpleAttributeDefinition definition = ( SimpleAttributeDefinition ) JacORBSubsystemDefinitions . valueOf ( initializer ) ; if ( definition != null && JacORBSubsystemDefinitions . ORB_INIT_ATTRIBUTES . contains ( definition ) ) node . get ( definition . getName ( ) ) . set ( JacORBSubsystemConstants . ON ) ; else throw JacORBLogger . ROOT_LOGGER . invalidInitializerConfig ( initializer , reader . getLocation ( ) ) ; } }


signature:
public class JacORBSubsystemParser { /** * Parses the ORB { @ code initializers } section of the JacORB subsystem configuration according to the XSD version 1.1
 * or higher .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed ORB initializers configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseORBInitializersConfig ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse the initializers config attributes .
EnumSet < Attribute > attributes = EnumSet . of ( Attribute . ORB_INIT_SECURITY , Attribute . ORB_INIT_TRANSACTIONS ) ; this . parseAttributes ( reader , node , attributes , null ) ; // the initializers element doesn ' t have child elements .
requireNoContent ( reader ) ; // if security = " on " change it to security = " identity "
if ( node . has ( SECURITY ) && node . get ( SECURITY ) . asString ( ) . equals ( JacORBSubsystemConstants . ON ) ) { node . get ( SECURITY ) . set ( SecurityAllowedValues . IDENTITY . toString ( ) ) ; }


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code poa } section of the JacORB subsystem configuration .
 * @ param namespace the expected { @ code Namespace } of the parsed elements .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed POA configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parsePOAConfig ( Namespace namespace , XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse the poa config attributes .
EnumSet < Attribute > expectedAttributes = EnumSet . of ( Attribute . POA_MONITORING , Attribute . POA_QUEUE_WAIT , Attribute . POA_QUEUE_MIN , Attribute . POA_QUEUE_MAX ) ; this . parseAttributes ( reader , node , expectedAttributes , null ) ; // parse the poa config elements .
EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { // check the element namespace .
if ( namespace != Namespace . forUri ( reader . getNamespaceURI ( ) ) ) throw unexpectedElement ( reader ) ; final Element element = Element . forName ( reader . getLocalName ( ) ) ; // check for duplicate elements .
if ( ! encountered . add ( element ) ) { throw duplicateNamedElement ( reader , element . getLocalName ( ) ) ; } switch ( element ) { case POA_REQUEST_PROC : { // parse the poa request - processors config attributes .
EnumSet < Attribute > attributes = EnumSet . of ( Attribute . POA_REQUEST_PROC_POOL_SIZE , Attribute . POA_REQUEST_PROC_MAX_THREADS ) ; this . parseAttributes ( reader , node , attributes , null ) ; // the request - processors element doesn ' t have child elements .
requireNoContent ( reader ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code naming } section of the JacORB subsystem configuration .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed interoperability configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseNamingConfig ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse all naming attributes .
EnumSet < Attribute > expectedAttributes = EnumSet . of ( Attribute . NAMING_ROOT_CONTEXT , Attribute . NAMING_EXPORT_CORBALOC ) ; this . parseAttributes ( reader , node , expectedAttributes , null ) ; // the naming element doesn ' t have child elements .
requireNoContent ( reader ) ;


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code interop } section of the JacORB subsystem configuration .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed interoperability configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseInteropConfig ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse all interop attributes .
EnumSet < Attribute > expectedAttributes = EnumSet . of ( Attribute . INTEROP_SUN , Attribute . INTEROP_COMET , Attribute . INTEROP_IONA , Attribute . INTEROP_CHUNK_RMI_VALUETYPES , Attribute . INTEROP_LAX_BOOLEAN_ENCODING , Attribute . INTEROP_INDIRECTION_ENCODING_DISABLE , Attribute . INTEROP_STRICT_CHECK_ON_TC_CREATION ) ; this . parseAttributes ( reader , node , expectedAttributes , null ) ; // the interop element doesn ' t have child elements .
requireNoContent ( reader ) ;


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code security } section of the JacORB subsystem configuration according to the XSD version 1.0.
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed security configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseSecurityConfig_1_0 ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse all security attributes .
EnumSet < Attribute > expectedAttributes = EnumSet . of ( Attribute . SECURITY_SUPPORT_SSL , Attribute . SECURITY_ADD_COMPONENT_INTERCEPTOR , Attribute . SECURITY_CLIENT_SUPPORTS , Attribute . SECURITY_CLIENT_REQUIRES , Attribute . SECURITY_SERVER_SUPPORTS , Attribute . SECURITY_SERVER_REQUIRES , Attribute . SECURITY_USE_DOMAIN_SF , Attribute . SECURITY_USE_DOMAIN_SSF ) ; EnumSet < Attribute > parsedAttributes = EnumSet . noneOf ( Attribute . class ) ; for ( int i = 0 ; i < reader . getAttributeCount ( ) ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; String attrValue = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; // check for unexpected attributes .
if ( ! expectedAttributes . contains ( attribute ) ) throw unexpectedAttribute ( reader , i ) ; // check for duplicate attributes .
if ( ! parsedAttributes . add ( attribute ) ) { throw duplicateAttribute ( reader , attribute . getLocalName ( ) ) ; } switch ( attribute ) { // check the attributes that need to be converted from int to string .
case SECURITY_CLIENT_SUPPORTS : case SECURITY_CLIENT_REQUIRES : case SECURITY_SERVER_SUPPORTS : case SECURITY_SERVER_REQUIRES : SSLConfigValue value = SSLConfigValue . fromValue ( attrValue ) ; if ( value == null ) throw JacORBLogger . ROOT_LOGGER . invalidSSLConfig ( attrValue , reader . getLocation ( ) ) ; attrValue = value . toString ( ) ; default : SimpleAttributeDefinition definition = ( ( SimpleAttributeDefinition ) JacORBSubsystemDefinitions . valueOf ( attribute . getLocalName ( ) ) ) ; // a null definition represents an attribute that has been deprecated and is no longer used .
if ( definition != null ) definition . parseAndSetParameter ( attrValue , node , reader ) ; } } // the security element doesn ' t have child elements .
requireNoContent ( reader ) ;


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code security } section of the JacORB subsystem configuration according to the XSD version 1.1 or higher .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed security configuration .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseSecurityConfig ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// parse all security attributes .
EnumSet < Attribute > expectedAttributes = EnumSet . of ( Attribute . SECURITY_SUPPORT_SSL , Attribute . SECURITY_SECURITY_DOMAIN , Attribute . SECURITY_ADD_COMPONENT_INTERCEPTOR , Attribute . SECURITY_CLIENT_SUPPORTS , Attribute . SECURITY_CLIENT_REQUIRES , Attribute . SECURITY_SERVER_SUPPORTS , Attribute . SECURITY_SERVER_REQUIRES ) ; this . parseAttributes ( reader , node , expectedAttributes , null ) ; // the security element doesn ' t have child elements .
requireNoContent ( reader ) ;


signature:
public class JacORBSubsystemParser { /** * Parses the { @ code properties } section of the JacORB subsystem configuration .
 * @ param namespace the expected { @ code Namespace } of the parsed elements .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed properties .
 * @ throws XMLStreamException if an error occurs while parsing the XML . */
private void parsePropertiesConfig ( Namespace namespace , XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation:
// the properties element doesn ' t define any attributes , just sub - elements .
requireNoAttributes ( reader ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { // check the element namespace .
if ( namespace != Namespace . forUri ( reader . getNamespaceURI ( ) ) ) throw unexpectedElement ( reader ) ; final Element element = Element . forName ( reader . getLocalName ( ) ) ; switch ( element ) { case PROPERTY : { // parse the property element .
this . parseGenericProperty ( reader , node . get ( JacORBSubsystemConstants . PROPERTIES ) ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class JacORBSubsystemParser { /** * Parses a { @ code property } element according to the XSD version 1.0 and adds the key / value pair to the specified
 * { @ code ModelNode } .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that contains all parsed ORB properties .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseGenericProperty_1_0 ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation: String name = null ; String val = null ; EnumSet < Attribute > required = EnumSet . of ( Attribute . PROP_KEY , Attribute . PROP_VALUE ) ; final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; required . remove ( attribute ) ; switch ( attribute ) { case PROP_KEY : { name = value ; break ; } case PROP_VALUE : { val = value ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( ! required . isEmpty ( ) ) { throw missingRequired ( reader , required ) ; } node . get ( name ) . set ( val ) ; requireNoContent ( reader ) ;


signature:
public class JacORBSubsystemParser { /** * Parses a { @ code property } element according to the XSD version 1.1 or higher and adds the name / value pair to the
 * specified { @ code ModelNode } .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that contains all parsed ORB properties .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseGenericProperty ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException { } }

implementation: String name = null ; ModelNode val = null ; EnumSet < Attribute > required = EnumSet . of ( Attribute . NAME , Attribute . PROP_VALUE ) ; final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; required . remove ( attribute ) ; switch ( attribute ) { case NAME : { name = value ; break ; } case PROP_VALUE : { val = JacORBSubsystemDefinitions . PROPERTIES . parse ( value , reader . getLocation ( ) ) ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( ! required . isEmpty ( ) ) { throw missingRequired ( reader , required ) ; } node . get ( name ) . set ( val ) ; requireNoContent ( reader ) ;


signature:
public class JacORBSubsystemParser { /** * Parses all attributes from the current element and sets them in the specified { @ code ModelNode } .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param node the { @ code ModelNode } that will hold the parsed attributes .
 * @ param expectedAttributes an { @ code EnumSet } containing all expected attributes . If the parsed attribute is not
 * one of the expected attributes , an exception is thrown .
 * @ param requiredAttributes an { @ code EnumSet } containing all required attributes . If a required attribute is not
 * found , an exception is thrown .
 * @ throws XMLStreamException if an error occurs while parsing the XML , if an attribute is not one of the expected
 * attributes or if one of the required attributes is not parsed . */
private void parseAttributes ( XMLExtendedStreamReader reader , ModelNode node , EnumSet < Attribute > expectedAttributes , EnumSet < Attribute > requiredAttributes ) throws XMLStreamException { } }

implementation:
EnumSet < Attribute > parsedAttributes = EnumSet . noneOf ( Attribute . class ) ; if ( requiredAttributes == null ) { requiredAttributes = EnumSet . noneOf ( Attribute . class ) ; } for ( int i = 0 ; i < reader . getAttributeCount ( ) ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String attrValue = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; // check for unexpected attributes .
if ( ! expectedAttributes . contains ( attribute ) ) throw unexpectedAttribute ( reader , i ) ; // check for duplicate attributes .
if ( ! parsedAttributes . add ( attribute ) ) { throw duplicateAttribute ( reader , attribute . getLocalName ( ) ) ; } requiredAttributes . remove ( attribute ) ; ( ( SimpleAttributeDefinition ) JacORBSubsystemDefinitions . valueOf ( attribute . getLocalName ( ) ) ) . parseAndSetParameter ( attrValue , node , reader ) ; } // throw an exception if a required attribute wasn ' t found .
if ( ! requiredAttributes . isEmpty ( ) ) { throw missingRequired ( reader , requiredAttributes ) ; }


signature:
public class JacORBSubsystemParser { /** * Writes the { @ code orb } section of the JacORB subsystem configuration using the contents of the provided
 * { @ code ModelNode } .
 * @ param writer the { @ code XMLExtendedStreamWriter } used to write the configuration XML .
 * @ param node the { @ code ModelNode } that might contain ORB configuration properties .
 * @ throws XMLStreamException if an error occurs while writing the ORB configuration . */
private void writeORBConfig ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } }

implementation:
boolean writeORB = this . isWritable ( node , JacORBSubsystemDefinitions . ORB_ATTRIBUTES ) ; boolean writeORBConnection = this . isWritable ( node , JacORBSubsystemDefinitions . ORB_CONN_ATTRIBUTES ) ; boolean writeORBInitializer = this . isWritable ( node , JacORBSubsystemDefinitions . ORB_INIT_ATTRIBUTES ) ; // if no connection or initializers properties are available , just write the orb properties ( if any ) in an empty element .
if ( ! writeORBConnection && ! writeORBInitializer ) { if ( writeORB ) { writer . writeEmptyElement ( JacORBSubsystemConstants . ORB ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . ORB_ATTRIBUTES ) ; } } // otherwise write the orb element with the appropriate sub - elements .
else { writer . writeStartElement ( JacORBSubsystemConstants . ORB ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . ORB_ATTRIBUTES ) ; if ( writeORBConnection ) { writer . writeEmptyElement ( JacORBSubsystemConstants . ORB_CONN ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . ORB_CONN_ATTRIBUTES ) ; } if ( writeORBInitializer ) { writer . writeEmptyElement ( JacORBSubsystemConstants . ORB_INIT ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . ORB_INIT_ATTRIBUTES ) ; } writer . writeEndElement ( ) ; }


signature:
public class JacORBSubsystemParser { /** * Writes the { @ code poa } section of the JacORB subsystem configuration using the contents of the provided
 * { @ code ModelNode } .
 * @ param writer the { @ code XMLExtendedStreamWriter } used to write the configuration XML .
 * @ param node the { @ code ModelNode } that might contain POA configuration properties .
 * @ throws XMLStreamException if an error occurs while writing the POA configuration . */
private void writePOAConfig ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } }

implementation:
boolean writePOA = this . isWritable ( node , JacORBSubsystemDefinitions . POA_ATTRIBUTES ) ; boolean writePOARP = this . isWritable ( node , JacORBSubsystemDefinitions . POA_RP_ATTRIBUTES ) ; // if no request processor properties are available , just write the poa properties ( if any ) in an empty element .
if ( ! writePOARP ) { if ( writePOA ) { writer . writeEmptyElement ( JacORBSubsystemConstants . POA ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . POA_ATTRIBUTES ) ; } } // otherwise write the poa element with the appropriate sub - elements .
else { writer . writeStartElement ( JacORBSubsystemConstants . POA ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . POA_ATTRIBUTES ) ; writer . writeEmptyElement ( JacORBSubsystemConstants . POA_RP ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . POA_RP_ATTRIBUTES ) ; writer . writeEndElement ( ) ; }


signature:
public class JacORBSubsystemParser { /** * Writes the { @ code naming } section of the JacORB subsystem configuration using the contents of the provided
 * { @ code ModelNode } .
 * @ param writer the { @ code XMLExtendedStreamWriter } used to write the configuration XML .
 * @ param node the { @ code ModelNode } that contains the naming configuration properties .
 * @ throws XMLStreamException if an error occurs while writing the interop configuration . */
private void writeNamingConfig ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } }

implementation: boolean writeNaming = this . isWritable ( node , JacORBSubsystemDefinitions . NAMING_ATTRIBUTES ) ; if ( writeNaming ) { writer . writeEmptyElement ( JacORBSubsystemConstants . NAMING ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . NAMING_ATTRIBUTES ) ; }


signature:
public class JacORBSubsystemParser { /** * Writes the { @ code interop } section of the JacORB subsystem configuration using the contents of the provided
 * { @ code ModelNode } .
 * @ param writer the { @ code XMLExtendedStreamWriter } used to write the configuration XML .
 * @ param node the { @ code ModelNode } that contains the interoperability configuration properties .
 * @ throws XMLStreamException if an error occurs while writing the interop configuration . */
private void writeInteropConfig ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } }

implementation: boolean writeInterop = this . isWritable ( node , JacORBSubsystemDefinitions . INTEROP_ATTRIBUTES ) ; if ( writeInterop ) { writer . writeEmptyElement ( JacORBSubsystemConstants . INTEROP ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . INTEROP_ATTRIBUTES ) ; }


signature:
public class JacORBSubsystemParser { /** * Writes the { @ code security } section of the JacORB subsystem configuration using the contents of the provided
 * { @ code ModelNode } .
 * @ param writer the { @ code XMLExtendedStreamWriter } used to write the configuration XML .
 * @ param node the { @ code ModelNode } that contains the security configuration properties .
 * @ throws XMLStreamException if an error occurs while writing the security configuration . */
private void writeSecurityConfig ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } }

implementation: boolean writeSecurity = this . isWritable ( node , JacORBSubsystemDefinitions . SECURITY_ATTRIBUTES ) ; if ( writeSecurity ) { writer . writeEmptyElement ( SECURITY ) ; this . writeAttributes ( writer , node , JacORBSubsystemDefinitions . SECURITY_ATTRIBUTES ) ; }


signature:
public class JacORBSubsystemParser { /** * Writes a { @ code property } element for each generic property contained in the specified { @ code ModelNode } .
 * @ param writer the { @ code XMLExtendedStreamWriter } used to write the configuration XML .
 * @ param node the { @ code ModelNode } that contains all properties to be written .
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while writing the property elements . */
private void writeGenericProperties ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } }

implementation: writer . writeStartElement ( JacORBSubsystemConstants . PROPERTIES ) ; for ( Property prop : node . asPropertyList ( ) ) { writer . writeEmptyElement ( JacORBSubsystemConstants . PROPERTY ) ; writer . writeAttribute ( JacORBSubsystemConstants . NAME , prop . getName ( ) ) ; writer . writeAttribute ( JacORBSubsystemConstants . PROPERTY_VALUE , prop . getValue ( ) . asString ( ) ) ; } writer . writeEndElement ( ) ;


signature:
public class JacORBSubsystemParser { /** * Writes the attributes contained in the specified { @ code ModelNode } to the current element .
 * @ param writer the { @ code XMLExtendedStreamWriter } used to write the configuration XML .
 * @ param node the { @ code ModelNode } that contains the attributes to be written .
 * @ param attributes the list of attributes to be written if they have been defined .
 * @ throws XMLStreamException if an error occurs while writing the attributes to the current element . */
private void writeAttributes ( XMLExtendedStreamWriter writer , ModelNode node , List < SimpleAttributeDefinition > attributes ) throws XMLStreamException { } }

implementation: for ( SimpleAttributeDefinition definition : attributes ) definition . marshallAsAttribute ( node , writer ) ;


signature:
public class JacORBSubsystemParser { /** * Iterates through the specified attribute definitions and checks if any of the attributes can be written to XML
 * by verifying if the attribute has been defined in the supplied node .
 * @ param node the { @ code ModelNode } that contains the configuration attributes .
 * @ param attributeDefinitions the { @ code AttributeDefinition } s of the attributes that might be writable .
 * @ return { @ code true } if the node has defined any of the attributes ; { @ code false } otherwise . */
private boolean isWritable ( ModelNode node , List < SimpleAttributeDefinition > attributeDefinitions ) { } }

implementation: boolean isWritable = false ; for ( SimpleAttributeDefinition attributeDefinition : attributeDefinitions ) { if ( attributeDefinition . isMarshallable ( node ) ) { isWritable = true ; break ; } } return isWritable ;


signature:
public class ModuleContextProcessor { /** * Add a ContextService for this module .
 * @ param phaseContext the deployment unit context
 * @ throws org . jboss . as . server . deployment . DeploymentUnitProcessingException */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation:
final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( DeploymentTypeMarker . isType ( DeploymentType . EAR , deploymentUnit ) ) { return ; } EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final ServiceName appContextServiceName = ContextNames . contextServiceNameOfApplication ( moduleDescription . getApplicationName ( ) ) ; final ServiceName moduleContextServiceName = ContextNames . contextServiceNameOfModule ( moduleDescription . getApplicationName ( ) , moduleDescription . getModuleName ( ) ) ; final NamingStoreService contextService = new NamingStoreService ( true ) ; serviceTarget . addService ( moduleContextServiceName , contextService ) . install ( ) ; final ServiceName moduleNameServiceName = moduleContextServiceName . append ( "ModuleName" ) ; final BinderService moduleNameBinder = new BinderService ( "ModuleName" ) ; moduleNameBinder . getManagedObjectInjector ( ) . inject ( new ValueManagedReferenceFactory ( Values . immediateValue ( moduleDescription . getModuleName ( ) ) ) ) ; serviceTarget . addService ( moduleNameServiceName , moduleNameBinder ) . addDependency ( moduleContextServiceName , ServiceBasedNamingStore . class , moduleNameBinder . getNamingStoreInjector ( ) ) . install ( ) ; deploymentUnit . addToAttachmentList ( org . jboss . as . server . deployment . Attachments . JNDI_DEPENDENCIES , moduleNameServiceName ) ; deploymentUnit . putAttachment ( MODULE_CONTEXT_CONFIG , moduleContextServiceName ) ; final InjectedEENamespaceContextSelector selector = new InjectedEENamespaceContextSelector ( ) ; phaseContext . addDependency ( appContextServiceName , NamingStore . class , selector . getAppContextInjector ( ) ) ; phaseContext . addDependency ( moduleContextServiceName , NamingStore . class , selector . getModuleContextInjector ( ) ) ; phaseContext . addDependency ( moduleContextServiceName , NamingStore . class , selector . getCompContextInjector ( ) ) ; phaseContext . addDependency ( ContextNames . JBOSS_CONTEXT_SERVICE_NAME , NamingStore . class , selector . getJbossContextInjector ( ) ) ; phaseContext . addDependency ( ContextNames . EXPORTED_CONTEXT_SERVICE_NAME , NamingStore . class , selector . getExportedContextInjector ( ) ) ; phaseContext . addDependency ( ContextNames . GLOBAL_CONTEXT_SERVICE_NAME , NamingStore . class , selector . getGlobalContextInjector ( ) ) ; moduleDescription . setNamespaceContextSelector ( selector ) ; final Set < ServiceName > serviceNames = new HashSet < ServiceName > ( ) ; serviceNames . add ( appContextServiceName ) ; serviceNames . add ( moduleContextServiceName ) ; serviceNames . add ( ContextNames . JBOSS_CONTEXT_SERVICE_NAME ) ; serviceNames . add ( ContextNames . GLOBAL_CONTEXT_SERVICE_NAME ) ; // add the arquillian setup action , so the module namespace is available in arquillian tests
final JavaNamespaceSetup setupAction = new JavaNamespaceSetup ( selector , deploymentUnit . getServiceName ( ) ) ; deploymentUnit . addToAttachmentList ( SETUP_ACTIONS , setupAction ) ; deploymentUnit . addToAttachmentList ( org . jboss . as . ee . component . Attachments . WEB_SETUP_ACTIONS , setupAction ) ; deploymentUnit . putAttachment ( Attachments . JAVA_NAMESPACE_SETUP_ACTION , setupAction ) ;


signature:
public class PersistenceRefProcessor { /** * Resolves persistence - unit - ref
 * @ param environment The environment to resolve the elements for
 * @ param classLoader The deployment class loader
 * @ param deploymentReflectionIndex The reflection index
 * @ return The bindings for the environment entries */
private List < BindingConfiguration > getPersistenceUnitRefs ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , ResourceInjectionTarget resourceInjectionTarget ) throws DeploymentUnitProcessingException { } }

implementation:
final List < BindingConfiguration > bindingConfigurations = new ArrayList < BindingConfiguration > ( ) ; if ( environment . getEnvironment ( ) == null ) { return bindingConfigurations ; } PersistenceUnitReferencesMetaData persistenceUnitRefs = environment . getEnvironment ( ) . getPersistenceUnitRefs ( ) ; if ( persistenceUnitRefs != null ) { if ( persistenceUnitRefs . size ( ) > 0 ) { JPADeploymentMarker . mark ( deploymentUnit ) ; } for ( PersistenceUnitReferenceMetaData puRef : persistenceUnitRefs ) { String name = puRef . getName ( ) ; String persistenceUnitName = puRef . getPersistenceUnitName ( ) ; String lookup = puRef . getLookupName ( ) ; if ( ! isEmpty ( lookup ) && ! isEmpty ( persistenceUnitName ) ) { throw JpaLogger . ROOT_LOGGER . cannotSpecifyBoth ( "<lookup-name>" , lookup , "persistence-unit-name" , persistenceUnitName , "<persistence-unit-ref/>" , resourceInjectionTarget ) ; } 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
processInjectionTargets ( resourceInjectionTarget , injectionSource , classLoader , deploymentReflectionIndex , puRef , EntityManagerFactory . class ) ; BindingConfiguration bindingConfiguration = null ; if ( ! isEmpty ( lookup ) ) { bindingConfiguration = new BindingConfiguration ( name , new LookupInjectionSource ( lookup ) ) ; } else { InjectionSource puBindingSource = this . getPersistenceUnitBindingSource ( deploymentUnit , persistenceUnitName ) ; bindingConfiguration = new BindingConfiguration ( name , puBindingSource ) ; } bindingConfigurations . add ( bindingConfiguration ) ; } } return bindingConfigurations ;


signature:
public class PersistenceRefProcessor { /** * Resolves persistence - unit - ref
 * @ param environment The environment to resolve the elements for
 * @ param classLoader The deployment class loader
 * @ param deploymentReflectionIndex The reflection index
 * @ return The bindings for the environment entries */
private List < BindingConfiguration > getPersistenceContextRefs ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , ResourceInjectionTarget resourceInjectionTarget ) throws DeploymentUnitProcessingException { } }

implementation:
List < BindingConfiguration > bindingConfigurations = new ArrayList < BindingConfiguration > ( ) ; final RemoteEnvironment remoteEnvironment = environment . getEnvironment ( ) ; if ( remoteEnvironment == null ) { return bindingConfigurations ; } if ( remoteEnvironment instanceof Environment ) { PersistenceContextReferencesMetaData persistenceUnitRefs = ( ( Environment ) remoteEnvironment ) . getPersistenceContextRefs ( ) ; if ( persistenceUnitRefs != null ) { for ( PersistenceContextReferenceMetaData puRef : persistenceUnitRefs ) { String name = puRef . getName ( ) ; String persistenceUnitName = puRef . getPersistenceUnitName ( ) ; String lookup = puRef . getLookupName ( ) ; if ( ! isEmpty ( lookup ) && ! isEmpty ( persistenceUnitName ) ) { throw JpaLogger . ROOT_LOGGER . cannotSpecifyBoth ( "<lookup-name>" , lookup , "persistence-unit-name" , persistenceUnitName , "<persistence-context-ref/>" , resourceInjectionTarget ) ; } 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
processInjectionTargets ( resourceInjectionTarget , injectionSource , classLoader , deploymentReflectionIndex , puRef , EntityManager . class ) ; BindingConfiguration bindingConfiguration = null ; if ( ! isEmpty ( lookup ) ) { bindingConfiguration = new BindingConfiguration ( name , new LookupInjectionSource ( lookup ) ) ; } else { PropertiesMetaData properties = puRef . getProperties ( ) ; Map < String , String > map = new HashMap < > ( ) ; if ( properties != null ) { for ( PropertyMetaData prop : properties ) { map . put ( prop . getKey ( ) , prop . getValue ( ) ) ; } } PersistenceContextType type = ( puRef . getPersistenceContextType ( ) == null || puRef . getPersistenceContextType ( ) == PersistenceContextTypeDescription . TRANSACTION ) ? PersistenceContextType . TRANSACTION : PersistenceContextType . EXTENDED ; SynchronizationType synchronizationType = ( puRef . getPersistenceContextSynchronization ( ) == null || PersistenceContextSynchronizationType . Synchronized . equals ( puRef . getPersistenceContextSynchronization ( ) ) ) ? SynchronizationType . SYNCHRONIZED : SynchronizationType . UNSYNCHRONIZED ; InjectionSource pcBindingSource = this . getPersistenceContextBindingSource ( deploymentUnit , persistenceUnitName , type , synchronizationType , map ) ; bindingConfiguration = new BindingConfiguration ( name , pcBindingSource ) ; } bindingConfigurations . add ( bindingConfiguration ) ; } } } return bindingConfigurations ;


signature:
public class SarModuleDependencyProcessor { /** * Add dependencies for modules required for manged bean deployments , if managed bean configurations are attached
 * to the deployment .
 * @ param phaseContext the deployment unit context
 * @ throws DeploymentUnitProcessingException */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation:
final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( Attachments . MODULE_SPECIFICATION ) ; final JBossServiceXmlDescriptor serviceXmlDescriptor = deploymentUnit . getAttachment ( JBossServiceXmlDescriptor . ATTACHMENT_KEY ) ; if ( serviceXmlDescriptor == null ) { return ; // Skip deployments with out a service xml descriptor
} moduleSpecification . addSystemDependency ( new ModuleDependency ( Module . getBootModuleLoader ( ) , JBOSS_MODULES_ID , false , false , false , false ) ) ; moduleSpecification . addSystemDependency ( new ModuleDependency ( Module . getBootModuleLoader ( ) , JBOSS_AS_SYSTEM_JMX_ID , true , false , false , false ) ) ; // depend on Properties editor module which uses ServiceLoader approach to load the appropriate org . jboss . common . beans . property . finder . PropertyEditorFinder
moduleSpecification . addSystemDependency ( new ModuleDependency ( Module . getBootModuleLoader ( ) , PROPERTIES_EDITOR_MODULE_ID , false , false , true , false ) ) ; // All SARs require the ability to register MBeans .
moduleSpecification . addPermissionFactory ( REGISTER_PERMISSION_FACTORY ) ;


signature:
public class ElytronSecurityContext { /** * Runs the work contained in { @ param runnable } as an authenticated Identity .
 * @ param work executes the work */
public void runWork ( Runnable work ) { } }

implementation:
// if we have an authenticated subject we check if it contains a security identity and use the identity to run the work .
if ( this . authenticatedSubject != null ) { Set < SecurityIdentity > authenticatedIdentities = this . getPrivateCredentials ( SecurityIdentity . class ) ; if ( ! authenticatedIdentities . isEmpty ( ) ) { SecurityIdentity identity = authenticatedIdentities . iterator ( ) . next ( ) ; identity . runAs ( work ) ; return ; } } // no authenticated subject found or the subject didn ' t have a security identity - just run the work .
work . run ( ) ;


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

implementation:
// no attributes
if ( reader . getAttributeCount ( ) > 0 ) { throw unexpectedAttribute ( reader , 0 ) ; } final ModelNode address = new ModelNode ( ) ; address . add ( ModelDescriptionConstants . SUBSYSTEM , TransactionExtension . SUBSYSTEM_NAME ) ; address . protect ( ) ; final ModelNode subsystem = new ModelNode ( ) ; subsystem . get ( OP ) . set ( ADD ) ; subsystem . get ( OP_ADDR ) . set ( address ) ; list . add ( subsystem ) ; final ModelNode logStoreAddress = address . clone ( ) ; final ModelNode logStoreOperation = new ModelNode ( ) ; logStoreOperation . get ( OP ) . set ( ADD ) ; logStoreAddress . add ( LogStoreConstants . LOG_STORE , LogStoreConstants . LOG_STORE ) ; logStoreAddress . protect ( ) ; logStoreOperation . get ( OP_ADDR ) . set ( logStoreAddress ) ; list . add ( logStoreOperation ) ; // elements
final EnumSet < Element > required = EnumSet . of ( Element . RECOVERY_ENVIRONMENT , Element . CORE_ENVIRONMENT ) ; final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; choiceObjectStoreEncountered = false ; needsDefaultRelativeTo = true ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { if ( Namespace . forUri ( reader . getNamespaceURI ( ) ) != getExpectedNamespace ( ) ) { throw unexpectedElement ( reader ) ; } final Element element = Element . forName ( reader . getLocalName ( ) ) ; required . remove ( element ) ; if ( ! encountered . add ( element ) ) { throw unexpectedElement ( reader ) ; } readElement ( reader , element , list , subsystem , logStoreOperation ) ; } if ( needsDefaultRelativeTo && relativeToHasDefaultValue ) { TransactionSubsystemRootResourceDefinition . OBJECT_STORE_RELATIVE_TO . parseAndSetParameter ( "jboss.server.data.dir" , subsystem , reader ) ; } if ( ! required . isEmpty ( ) ) { throw missingRequiredElement ( reader , required ) ; }


signature:
public class WSEndpointMetrics { /** * { @ inheritDoc } */
public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } }

implementation: if ( context . isNormalServer ( ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceRegistry registry = context . getServiceRegistry ( false ) ; if ( registry != null ) { try { context . getResult ( ) . set ( getEndpointMetricsFragment ( operation , registry ) ) ; } catch ( Exception e ) { throw new OperationFailedException ( getFallbackMessage ( ) + ": " + e . getMessage ( ) ) ; } } else { context . getResult ( ) . set ( getFallbackMessage ( ) ) ; } } } , OperationContext . Stage . RUNTIME ) ; } else { context . getResult ( ) . set ( getFallbackMessage ( ) ) ; }


signature:
public class SASTargetInterceptor { /** * Sets the outgoing SAS reply to < code > ContextError < / code > , with major status " invalid evidence " . */
void rejectIncomingContext ( ) { } }

implementation:
CurrentRequestInfo threadLocal = threadLocalData . get ( ) ; if ( threadLocal . sasContextReceived ) { threadLocal . sasReply = ( threadLocal . contextId == 0 ) ? msgCtx0Rejected : createMsgCtxError ( threadLocal . contextId , 1 /* major status : invalid evidence */
) ; threadLocal . sasReplyIsAccept = false ; }


signature:
public class PersistenceUnitServiceHandler { /** * Add one PU service per top level deployment that represents
 * @ param phaseContext
 * @ param puList
 * @ param startEarly
 * @ param platform
 * @ throws DeploymentUnitProcessingException */
private static void addPuService ( final DeploymentPhaseContext phaseContext , final ArrayList < PersistenceUnitMetadataHolder > puList , final boolean startEarly , final Platform platform ) throws DeploymentUnitProcessingException { } }

implementation:
if ( puList . size ( ) > 0 ) { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final Module module = deploymentUnit . getAttachment ( Attachments . MODULE ) ; final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( org . jboss . as . ee . component . Attachments . EE_MODULE_DESCRIPTION ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final ModuleClassLoader classLoader = module . getClassLoader ( ) ; for ( PersistenceUnitMetadataHolder holder : puList ) { setAnnotationIndexes ( holder , deploymentUnit ) ; for ( PersistenceUnitMetadata pu : holder . getPersistenceUnits ( ) ) { // only start the persistence unit if JPA _ CONTAINER _ MANAGED is true
String jpaContainerManaged = pu . getProperties ( ) . getProperty ( Configuration . JPA_CONTAINER_MANAGED ) ; boolean deployPU = ( jpaContainerManaged == null ? true : Boolean . parseBoolean ( jpaContainerManaged ) ) ; if ( deployPU ) { final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = getPersistenceProviderDeploymentHolder ( deploymentUnit ) ; final PersistenceProvider provider = lookupProvider ( pu , persistenceProviderDeploymentHolder , deploymentUnit ) ; final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor ( pu , persistenceProviderDeploymentHolder , deploymentUnit , provider , platform ) ; final boolean twoPhaseBootStrapCapable = ( adaptor instanceof TwoPhaseBootstrapCapable ) && Configuration . allowTwoPhaseBootstrap ( pu ) ; if ( startEarly ) { if ( twoPhaseBootStrapCapable ) { deployPersistenceUnitPhaseOne ( deploymentUnit , eeModuleDescription , serviceTarget , classLoader , pu , adaptor ) ; } else if ( false == Configuration . needClassFileTransformer ( pu ) ) { // will start later when startEarly = = false
ROOT_LOGGER . tracef ( "persistence unit %s in deployment %s is configured to not need class transformer to be set, no class rewriting will be allowed" , pu . getPersistenceUnitName ( ) , deploymentUnit . getName ( ) ) ; } else { // we need class file transformer to work , don ' t allow cdi bean manager to be access since that
// could cause application classes to be loaded ( workaround by setting jboss . as . jpa . classtransformer to false ) . WFLY - 1463
final boolean allowCdiBeanManagerAccess = false ; deployPersistenceUnit ( deploymentUnit , eeModuleDescription , serviceTarget , classLoader , pu , provider , adaptor , allowCdiBeanManagerAccess ) ; } } else { // ! startEarly
if ( twoPhaseBootStrapCapable ) { deployPersistenceUnitPhaseTwo ( deploymentUnit , eeModuleDescription , serviceTarget , classLoader , pu , provider , adaptor ) ; } else if ( false == Configuration . needClassFileTransformer ( pu ) ) { final boolean allowCdiBeanManagerAccess = true ; // PUs that have Configuration . JPA _ CONTAINER _ CLASS _ TRANSFORMER = false will start during INSTALL phase
deployPersistenceUnit ( deploymentUnit , eeModuleDescription , serviceTarget , classLoader , pu , provider , adaptor , allowCdiBeanManagerAccess ) ; } } } else { ROOT_LOGGER . tracef ( "persistence unit %s in deployment %s is not container managed (%s is set to false)" , pu . getPersistenceUnitName ( ) , deploymentUnit . getName ( ) , Configuration . JPA_CONTAINER_MANAGED ) ; } } } }


signature:
public class PersistenceUnitServiceHandler { /** * first phase of starting the persistence unit
 * @ param deploymentUnit
 * @ param eeModuleDescription
 * @ param serviceTarget
 * @ param classLoader
 * @ param pu
 * @ param adaptor
 * @ throws DeploymentUnitProcessingException */
private static void deployPersistenceUnitPhaseOne ( final DeploymentUnit deploymentUnit , final EEModuleDescription eeModuleDescription , final ServiceTarget serviceTarget , final ModuleClassLoader classLoader , final PersistenceUnitMetadata pu , final PersistenceProviderAdaptor adaptor ) throws DeploymentUnitProcessingException { } }

implementation:
CapabilityServiceSupport capabilitySupport = deploymentUnit . getAttachment ( Attachments . CAPABILITY_SERVICE_SUPPORT ) ; pu . setClassLoader ( classLoader ) ; try { final HashMap < String , ValidatorFactory > properties = new HashMap < > ( ) ; ProxyBeanManager proxyBeanManager = null ; // JPA 2.1 sections 3.5.1 + 9.1 require the CDI bean manager to be passed to the peristence provider
// if the persistence unit is contained in a deployment that is a CDI bean archive ( has beans . xml ) .
final CapabilityServiceSupport support = deploymentUnit . getAttachment ( Attachments . CAPABILITY_SERVICE_SUPPORT ) ; boolean partOfWeldDeployment = false ; if ( support . hasCapability ( WELD_CAPABILITY_NAME ) ) { partOfWeldDeployment = support . getOptionalCapabilityRuntimeAPI ( WELD_CAPABILITY_NAME , WeldCapability . class ) . get ( ) . isPartOfWeldDeployment ( deploymentUnit ) ; } if ( partOfWeldDeployment ) { proxyBeanManager = new ProxyBeanManager ( ) ; registerJPAEntityListenerRegister ( deploymentUnit , support ) ; // register CDI extension before WeldDeploymentProcessor , which is important for
// EAR deployments that contain a WAR that has persistence units defined .
} deploymentUnit . addToAttachmentList ( REMOVAL_KEY , new PersistenceAdaptorRemoval ( pu , adaptor ) ) ; // add persistence provider specific properties
adaptor . addProviderProperties ( properties , pu ) ; final ServiceName puServiceName = PersistenceUnitServiceImpl . getPUServiceName ( pu ) . append ( FIRST_PHASE ) ; deploymentUnit . putAttachment ( JpaAttachments . PERSISTENCE_UNIT_SERVICE_KEY , puServiceName ) ; deploymentUnit . addToAttachmentList ( Attachments . DEPLOYMENT_COMPLETE_SERVICES , puServiceName ) ; deploymentUnit . addToAttachmentList ( Attachments . WEB_DEPENDENCIES , puServiceName ) ; final PhaseOnePersistenceUnitServiceImpl service = new PhaseOnePersistenceUnitServiceImpl ( classLoader , pu , adaptor , deploymentUnit . getServiceName ( ) , proxyBeanManager ) ; service . getPropertiesInjector ( ) . inject ( properties ) ; ServiceBuilder < PhaseOnePersistenceUnitServiceImpl > builder = serviceTarget . addService ( puServiceName , service ) ; boolean useDefaultDataSource = Configuration . allowDefaultDataSourceUse ( pu ) ; final String jtaDataSource = adjustJndi ( pu . getJtaDataSourceName ( ) ) ; final String nonJtaDataSource = adjustJndi ( pu . getNonJtaDataSourceName ( ) ) ; if ( jtaDataSource != null && jtaDataSource . length ( ) > 0 ) { if ( jtaDataSource . equals ( EE_DEFAULT_DATASOURCE ) ) { // explicit use of default datasource
useDefaultDataSource = true ; } else { builder . addDependency ( ContextNames . bindInfoForEnvEntry ( eeModuleDescription . getApplicationName ( ) , eeModuleDescription . getModuleName ( ) , eeModuleDescription . getModuleName ( ) , false , jtaDataSource ) . getBinderServiceName ( ) , ManagedReferenceFactory . class , new ManagedReferenceFactoryInjector ( service . getJtaDataSourceInjector ( ) ) ) ; useDefaultDataSource = false ; } } if ( nonJtaDataSource != null && nonJtaDataSource . length ( ) > 0 ) { builder . addDependency ( ContextNames . bindInfoForEnvEntry ( eeModuleDescription . getApplicationName ( ) , eeModuleDescription . getModuleName ( ) , eeModuleDescription . getModuleName ( ) , false , nonJtaDataSource ) . getBinderServiceName ( ) , ManagedReferenceFactory . class , new ManagedReferenceFactoryInjector ( service . getNonJtaDataSourceInjector ( ) ) ) ; useDefaultDataSource = false ; } // JPA 2.0 8.2.1.5 , container provides default JTA datasource
if ( useDefaultDataSource ) { // try the one defined in the jpa subsystem
String defaultJtaDataSource = null ; if ( eeModuleDescription != null ) { defaultJtaDataSource = eeModuleDescription . getDefaultResourceJndiNames ( ) . getDataSource ( ) ; } if ( defaultJtaDataSource == null || defaultJtaDataSource . isEmpty ( ) ) { // try the datasource defined in the JPA subsystem
defaultJtaDataSource = adjustJndi ( JPAService . getDefaultDataSourceName ( ) ) ; } if ( defaultJtaDataSource != null && ! defaultJtaDataSource . isEmpty ( ) ) { builder . addDependency ( ContextNames . bindInfoFor ( defaultJtaDataSource ) . getBinderServiceName ( ) , ManagedReferenceFactory . class , new ManagedReferenceFactoryInjector ( service . getJtaDataSourceInjector ( ) ) ) ; ROOT_LOGGER . tracef ( "%s is using the default data source '%s'" , puServiceName , defaultJtaDataSource ) ; } } try { // save a thread local reference to the builder for setting up the second level cache dependencies
CacheDeploymentListener . setInternalDeploymentSupport ( builder , capabilitySupport ) ; adaptor . addProviderDependencies ( pu ) ; } finally { CacheDeploymentListener . clearInternalDeploymentSupport ( ) ; } // get async executor from Services . addServerExecutorDependency
addServerExecutorDependency ( builder , service . getExecutorInjector ( ) ) ; builder . install ( ) ; ROOT_LOGGER . tracef ( "added PersistenceUnitService (phase 1 of 2) for '%s'.  PU is ready for injector action." , puServiceName ) ; } catch ( ServiceRegistryException e ) { throw JpaLogger . ROOT_LOGGER . failedToAddPersistenceUnit ( e , pu . getPersistenceUnitName ( ) ) ; }


signature:
public class PersistenceUnitServiceHandler { /** * Setup the annotation index map
 * @ param puHolder
 * @ param deploymentUnit */
private static void setAnnotationIndexes ( final PersistenceUnitMetadataHolder puHolder , DeploymentUnit deploymentUnit ) { } }

implementation:
final Map < URL , Index > annotationIndexes = new HashMap < > ( ) ; do { for ( ResourceRoot root : DeploymentUtils . allResourceRoots ( deploymentUnit ) ) { final Index index = root . getAttachment ( Attachments . ANNOTATION_INDEX ) ; if ( index != null ) { try { ROOT_LOGGER . tracef ( "adding '%s' to annotation index map" , root . getRoot ( ) . toURL ( ) ) ; annotationIndexes . put ( root . getRoot ( ) . toURL ( ) , index ) ; } catch ( MalformedURLException e ) { throw new RuntimeException ( e ) ; } } } deploymentUnit = deploymentUnit . getParent ( ) ; // get annotation indexes for top level also
} while ( deploymentUnit != null ) ; for ( PersistenceUnitMetadata pu : puHolder . getPersistenceUnits ( ) ) { pu . setAnnotationIndex ( annotationIndexes ) ; // hold onto the annotation index for Persistence Provider use during deployment
}


signature:
public class PersistenceUnitServiceHandler { /** * Will save the PersistenceProviderAdaptor at the top level application deployment unit level for sharing with other persistence units
 * @ param deploymentUnit
 * @ param adaptorModule
 * @ param adaptor
 * @ param provider
 * @ return the application level shared PersistenceProviderAdaptor ( which may of been set by a different thread ) */
private static PersistenceProviderAdaptor savePerDeploymentSharedPersistenceProviderAdaptor ( DeploymentUnit deploymentUnit , String adaptorModule , PersistenceProviderAdaptor adaptor , PersistenceProvider provider ) { } }

implementation:
if ( deploymentUnit . getParent ( ) != null ) { deploymentUnit = deploymentUnit . getParent ( ) ; } synchronized ( deploymentUnit ) { Map < String , PersistenceProviderAdaptor > map = deploymentUnit . getAttachment ( providerAdaptorMapKey ) ; String key ; if ( adaptorModule != null ) { key = adaptorModule ; // handle legacy adapter module
} else { key = provider . getClass ( ) . getName ( ) ; } PersistenceProviderAdaptor current = map . get ( key ) ; // saved if not already set by another thread
if ( current == null ) { map . put ( key , adaptor ) ; current = adaptor ; } return current ; }


signature:
public class PersistenceUnitServiceHandler { /** * The sub - deployment phases run in parallel , ensure that no deployment / sub - deployment moves past
 * Phase . FIRST _ MODULE _ USE , until the applications persistence unit services are started .
 * Note that some application persistence units will not be created until the Phase . INSTALL , in which case
 * NEXT _ PHASE _ DEPS is not needed . */
private static void nextPhaseDependsOnPersistenceUnit ( final DeploymentPhaseContext phaseContext , final Platform platform ) throws DeploymentUnitProcessingException { } }

implementation:
final DeploymentUnit topDeploymentUnit = DeploymentUtils . getTopDeploymentUnit ( phaseContext . getDeploymentUnit ( ) ) ; final PersistenceUnitsInApplication persistenceUnitsInApplication = topDeploymentUnit . getAttachment ( PersistenceUnitsInApplication . PERSISTENCE_UNITS_IN_APPLICATION ) ; for ( final PersistenceUnitMetadataHolder holder : persistenceUnitsInApplication . getPersistenceUnitHolders ( ) ) { for ( final PersistenceUnitMetadata pu : holder . getPersistenceUnits ( ) ) { String jpaContainerManaged = pu . getProperties ( ) . getProperty ( Configuration . JPA_CONTAINER_MANAGED ) ; boolean deployPU = ( jpaContainerManaged == null ? true : Boolean . parseBoolean ( jpaContainerManaged ) ) ; if ( deployPU ) { final ServiceName puServiceName = PersistenceUnitServiceImpl . getPUServiceName ( pu ) ; final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = getPersistenceProviderDeploymentHolder ( phaseContext . getDeploymentUnit ( ) ) ; final PersistenceProvider provider = lookupProvider ( pu , persistenceProviderDeploymentHolder , phaseContext . getDeploymentUnit ( ) ) ; final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor ( pu , persistenceProviderDeploymentHolder , phaseContext . getDeploymentUnit ( ) , provider , platform ) ; final boolean twoPhaseBootStrapCapable = ( adaptor instanceof TwoPhaseBootstrapCapable ) && Configuration . allowTwoPhaseBootstrap ( pu ) ; // only add the next phase dependency , if the persistence unit service is starting early .
if ( Configuration . needClassFileTransformer ( pu ) ) { // wait until the persistence unit service is started before starting the next deployment phase
phaseContext . addToAttachmentList ( Attachments . NEXT_PHASE_DEPS , twoPhaseBootStrapCapable ? puServiceName . append ( FIRST_PHASE ) : puServiceName ) ; } } } }


signature:
public class PersistenceUnitServiceHandler { /** * add to management console ( if ManagementAdapter is supported for provider ) .
 * full path to management data will be :
 * / deployment = Deployment / subsystem = jpa / hibernate - persistence - unit = FullyAppQualifiedPath # PersistenceUnitName / cache = EntityClassName
 * example of full path :
 * / deployment = jpa _ SecondLevelCacheTestCase . jar / subsystem = jpa / hibernate - persistence - unit = jpa _ SecondLevelCacheTestCase . jar # mypc /
 * cache = org . jboss . as . test . integration . jpa . hibernate . Employee
 * @ param deploymentUnit
 * @ param pu
 * @ param adaptor
 * @ param persistenceAdaptorRemoval */
private static void addManagementConsole ( final DeploymentUnit deploymentUnit , final PersistenceUnitMetadata pu , final PersistenceProviderAdaptor adaptor , PersistenceAdaptorRemoval persistenceAdaptorRemoval ) { } }

implementation:
ManagementAdaptor managementAdaptor = adaptor . getManagementAdaptor ( ) ; // workaround for AS7-4441 , if a custom hibernate . cache . region _ prefix is specified , don ' t show the persistence
// unit in management console .
if ( managementAdaptor != null && adaptor . doesScopedPersistenceUnitNameIdentifyCacheRegionName ( pu ) ) { final String providerLabel = managementAdaptor . getIdentificationLabel ( ) ; final String scopedPersistenceUnitName = pu . getScopedPersistenceUnitName ( ) ; Resource providerResource = JPAService . createManagementStatisticsResource ( managementAdaptor , scopedPersistenceUnitName , deploymentUnit ) ; // Resource providerResource = managementAdaptor . createPersistenceUnitResource ( scopedPersistenceUnitName , providerLabel ) ;
ModelNode perPuNode = providerResource . getModel ( ) ; perPuNode . get ( SCOPED_UNIT_NAME . getName ( ) ) . set ( pu . getScopedPersistenceUnitName ( ) ) ; // TODO this is a temporary hack into internals until DeploymentUnit exposes a proper Resource - based API
final Resource deploymentResource = deploymentUnit . getAttachment ( DeploymentModelUtils . DEPLOYMENT_RESOURCE ) ; Resource subsystemResource ; synchronized ( deploymentResource ) { subsystemResource = getOrCreateResource ( deploymentResource , PathElement . pathElement ( ModelDescriptionConstants . SUBSYSTEM , "jpa" ) ) ; } synchronized ( subsystemResource ) { subsystemResource . registerChild ( PathElement . pathElement ( providerLabel , scopedPersistenceUnitName ) , providerResource ) ; // save the subsystemResource reference + path to scoped pu , so we can remove it during undeploy
persistenceAdaptorRemoval . registerManagementConsoleChild ( subsystemResource , PathElement . pathElement ( providerLabel , scopedPersistenceUnitName ) ) ; } }


signature:
public class PersistenceUnitServiceHandler { /** * TODO this is a temporary hack into internals until DeploymentUnit exposes a proper Resource - based API */
private static Resource getOrCreateResource ( final Resource parent , final PathElement element ) { } }

implementation: synchronized ( parent ) { if ( parent . hasChild ( element ) ) { return parent . requireChild ( element ) ; } else { final Resource resource = Resource . Factory . create ( ) ; parent . registerChild ( element , resource ) ; return resource ; } }


signature:
public class JandexAnnotationProvider { /** * use a plain Set and it should work for both versions . */
@ Override public Map < Class < ? extends Annotation > , Set < Class < ? > > > getAnnotatedClasses ( final Set uris ) { } }

implementation: return annotations ; // TODO : Should this be limited by URI