signature:
public class Configuration { /** * Allow the mixed synchronization checking to be skipped for backward compatibility with WildFly 10.1.0
 * @ param emf
 * @ param targetEntityManagerProperties
 * @ return */
public static boolean skipMixedSynchronizationTypeCheck ( EntityManagerFactory emf , Map targetEntityManagerProperties ) { } }

implementation:
boolean result = false ; // EntityManager properties will take priority over persistence . xml level ( emf ) properties
if ( targetEntityManagerProperties != null && targetEntityManagerProperties . containsKey ( SKIPMIXEDSYNCTYPECHECKING ) ) { result = Boolean . parseBoolean ( ( String ) targetEntityManagerProperties . get ( SKIPMIXEDSYNCTYPECHECKING ) ) ; } else if ( emf . getProperties ( ) != null && emf . getProperties ( ) . containsKey ( SKIPMIXEDSYNCTYPECHECKING ) ) { result = Boolean . parseBoolean ( ( String ) emf . getProperties ( ) . get ( SKIPMIXEDSYNCTYPECHECKING ) ) ; } return result ;


signature:
public class Configuration { /** * Allow an unsynchronized persistence context that is joined to the transaction , be treated the same as a synchronized
 * persistence context , with respect to the checking for mixed unsync / sync types .
 * @ param emf
 * @ param targetEntityManagerProperties
 * @ return */
public static boolean allowJoinedUnsyncPersistenceContext ( EntityManagerFactory emf , Map targetEntityManagerProperties ) { } }

implementation:
boolean result = false ; // EntityManager properties will take priority over persistence . xml ( emf ) properties
if ( targetEntityManagerProperties != null && targetEntityManagerProperties . containsKey ( ALLOWJOINEDUNSYNCPC ) ) { result = Boolean . parseBoolean ( ( String ) targetEntityManagerProperties . get ( ALLOWJOINEDUNSYNCPC ) ) ; } else if ( emf . getProperties ( ) != null && emf . getProperties ( ) . containsKey ( ALLOWJOINEDUNSYNCPC ) ) { result = Boolean . parseBoolean ( ( String ) emf . getProperties ( ) . get ( ALLOWJOINEDUNSYNCPC ) ) ; } return result ;


signature:
public class StrictMaxPoolAdd { /** * Populate the < code > strictMaxPoolModel < / code > from the < code > operation < / code >
 * @ param operation the operation
 * @ param strictMaxPoolModel strict - max - pool ModelNode
 * @ throws OperationFailedException */
@ Override protected void populateModel ( ModelNode operation , ModelNode strictMaxPoolModel ) throws OperationFailedException { } }

implementation: for ( AttributeDefinition attr : StrictMaxPoolResourceDefinition . ATTRIBUTES . values ( ) ) { attr . validateAndSet ( operation , strictMaxPoolModel ) ; }


signature:
public class CorbaUtils { /** * Returns the CORBA object reference associated with a Remote
 * object by using the javax . rmi . CORBA package .
 * Use reflection to avoid hard dependencies on javax . rmi . CORBA package .
 * This method effective does the following :
 * < blockquote > < pre >
 * java . lang . Object stub ;
 * try {
 * stub = PortableRemoteObject . toStub ( remoteObj ) ;
 * } catch ( Exception e ) {
 * throw new ConfigurationException ( " Object not exported or not found " ) ;
 * if ( ! ( stub instanceof javax . rmi . CORBA . Stub ) ) {
 * return null ; / / JRMP impl or JRMP stub
 * try {
 * ( ( javax . rmi . CORBA . Stub ) stub ) . connect ( orb ) ; / / try to connect IIOP stub
 * } catch ( RemoteException e ) {
 * / / ignore ' already connected ' error
 * return ( javax . rmi . CORBA . Stub ) stub ;
 * @ param remoteObj The non - null remote object for
 * @ param orb The non - null ORB to connect the remote object to
 * @ return The CORBA Object for remoteObj ; null if < tt > remoteObj < / tt >
 * is a JRMP implementation or JRMP stub .
 * @ throws ClassNotFoundException The RMI - IIOP package is not available
 * @ throws ConfigurationException The CORBA Object cannot be obtained
 * because of configuration problems . */
public static org . omg . CORBA . Object remoteToCorba ( Remote remoteObj , ORB orb ) throws ClassNotFoundException , ConfigurationException { } }

implementation:
synchronized ( CorbaUtils . class ) { if ( toStubMethod == null ) { initMethodHandles ( ) ; } } // First , get remoteObj ' s stub
// javax . rmi . CORBA . Stub stub = PortableRemoteObject . toStub ( remoteObj ) ;
java . lang . Object stub ; try { stub = toStubMethod . invoke ( null , new java . lang . Object [ ] { remoteObj } ) ; } catch ( InvocationTargetException e ) { Throwable realException = e . getTargetException ( ) ; // realException . printStackTrace ( ) ;
ConfigurationException ce = IIOPLogger . ROOT_LOGGER . problemInvokingPortableRemoteObjectToStub ( ) ; ce . setRootCause ( realException ) ; throw ce ; } catch ( IllegalAccessException e ) { ConfigurationException ce = IIOPLogger . ROOT_LOGGER . cannotInvokePortableRemoteObjectToStub ( ) ; ce . setRootCause ( e ) ; throw ce ; } // Next , make sure that the stub is javax . rmi . CORBA . Stub
if ( ! corbaStubClass . isInstance ( stub ) ) { return null ; // JRMP implementation or JRMP stub
} // Next , make sure that the stub is connected
// Invoke stub . connect ( orb )
try { connectMethod . invoke ( stub , new java . lang . Object [ ] { orb } ) ; } catch ( InvocationTargetException e ) { Throwable realException = e . getTargetException ( ) ; // realException . printStackTrace ( ) ;
if ( ! ( realException instanceof java . rmi . RemoteException ) ) { ConfigurationException ce = IIOPLogger . ROOT_LOGGER . problemInvokingStubConnect ( ) ; ce . setRootCause ( realException ) ; throw ce ; } // ignore RemoteException because stub might have already
// been connected
} catch ( IllegalAccessException e ) { ConfigurationException ce = IIOPLogger . ROOT_LOGGER . cannotInvokeStubConnect ( ) ; ce . setRootCause ( e ) ; throw ce ; } // Finally , return stub
return ( org . omg . CORBA . Object ) stub ;


signature:
public class CorbaUtils { /** * Get ORB using given server and port number , and properties from environment .
 * @ param server Possibly null server ; if null means use default ;
 * For applet , it is the applet host ; for app , it is localhost .
 * @ param port Port number , - 1 means default port
 * @ param env Possibly null environment . Contains environment properties .
 * Could contain ORB itself ; or applet used for initializing ORB .
 * Use all String properties from env for initializing ORB
 * @ return A non - null ORB . */
public static ORB getOrb ( String server , int port , Hashtable env ) { } }

implementation:
// See if we can get info from environment
Properties orbProp ; // Extract any org . omg . CORBA properties from environment
if ( env != null ) { // Get all String properties
orbProp = new Properties ( ) ; final Enumeration envProp = env . keys ( ) ; while ( envProp . hasMoreElements ( ) ) { String key = ( String ) envProp . nextElement ( ) ; Object val = env . get ( key ) ; if ( val instanceof String ) { orbProp . put ( key , val ) ; } } final Enumeration mainProps = orbProperties . keys ( ) ; while ( mainProps . hasMoreElements ( ) ) { String key = ( String ) mainProps . nextElement ( ) ; Object val = orbProperties . get ( key ) ; if ( val instanceof String ) { orbProp . put ( key , val ) ; } } } else { orbProp = orbProperties ; } if ( server != null ) { orbProp . put ( "org.omg.CORBA.ORBInitialHost" , server ) ; } if ( port >= 0 ) { orbProp . put ( "org.omg.CORBA.ORBInitialPort" , "" + port ) ; } // Get Applet from environment
if ( env != null ) { Object applet = env . get ( Context . APPLET ) ; if ( applet != null ) { // Create ORBs for an applet
return initAppletORB ( applet , orbProp ) ; } } // Create ORBs using orbProp for a standalone application
return ORB . init ( new String [ 0 ] , orbProp ) ;


signature:
public class CorbaUtils { /** * This method returns a new ORB instance for the given applet
 * without creating a static dependency on java . applet . */
private static ORB initAppletORB ( Object applet , Properties orbProp ) { } }

implementation:
try { Class < ? > appletClass = Class . forName ( "java.applet.Applet" , true , null ) ; if ( ! appletClass . isInstance ( applet ) ) { throw new ClassCastException ( applet . getClass ( ) . getName ( ) ) ; } // invoke the static method ORB . init ( applet , orbProp ) ;
Method method = ORB . class . getMethod ( "init" , appletClass , Properties . class ) ; return ( ORB ) method . invoke ( null , applet , orbProp ) ; } catch ( ClassNotFoundException e ) { // java . applet . Applet doesn ' t exist and the applet parameter is
// non - null ; so throw CCE
throw new ClassCastException ( applet . getClass ( ) . getName ( ) ) ; } catch ( NoSuchMethodException e ) { throw new AssertionError ( e ) ; } catch ( InvocationTargetException e ) { Throwable cause = e . getCause ( ) ; if ( cause instanceof RuntimeException ) { throw ( RuntimeException ) cause ; } else if ( cause instanceof Error ) { throw ( Error ) cause ; } throw new AssertionError ( e ) ; } catch ( IllegalAccessException iae ) { throw new AssertionError ( iae ) ; }


signature:
public class CorbaUtils { /** * Initializes reflection method handles for RMI - IIOP .
 * @ throws ClassNotFoundException javax . rmi . CORBA . * not available */
private static void initMethodHandles ( ) throws ClassNotFoundException { } }

implementation:
// Get javax . rmi . CORBA . Stub class
corbaStubClass = Class . forName ( "javax.rmi.CORBA.Stub" ) ; // Get javax . rmi . CORBA . Stub . connect ( org . omg . CORBA . ORB ) method
try { connectMethod = corbaStubClass . getMethod ( "connect" , new Class [ ] { org . omg . CORBA . ORB . class } ) ; } catch ( NoSuchMethodException e ) { throw IIOPLogger . ROOT_LOGGER . noMethodDefForStubConnect ( ) ; } // Get javax . rmi . PortableRemoteObject method
Class proClass = Class . forName ( "javax.rmi.PortableRemoteObject" ) ; // Get javax . rmi . PortableRemoteObject ( java . rmi . Remote ) method
try { toStubMethod = proClass . getMethod ( "toStub" , new Class [ ] { java . rmi . Remote . class } ) ; } catch ( NoSuchMethodException e ) { throw IIOPLogger . ROOT_LOGGER . noMethodDefForPortableRemoteObjectToStub ( ) ; }


signature:
public class NamingContext { /** * Set the active naming store
 * @ param namingStore The naming store */
public static void setActiveNamingStore ( final NamingStore namingStore ) { } }

implementation: if ( WildFlySecurityManager . isChecking ( ) ) { System . getSecurityManager ( ) . checkPermission ( SET_ACTIVE_NAMING_STORE ) ; } ACTIVE_NAMING_STORE = namingStore ;


signature:
public class NamingContext { /** * Initialize the naming components required by { @ link javax . naming . spi . NamingManager } . */
public static void initializeNamingManager ( ) { } }

implementation:
// Setup naming environment
final String property = WildFlySecurityManager . getPropertyPrivileged ( Context . URL_PKG_PREFIXES , null ) ; if ( property == null || property . isEmpty ( ) ) { WildFlySecurityManager . setPropertyPrivileged ( Context . URL_PKG_PREFIXES , PACKAGE_PREFIXES ) ; } else if ( ! Arrays . asList ( property . split ( ":" ) ) . contains ( PACKAGE_PREFIXES ) ) { WildFlySecurityManager . setPropertyPrivileged ( Context . URL_PKG_PREFIXES , PACKAGE_PREFIXES + ":" + property ) ; } try { // If we are reusing the JVM . e . g . in tests we should not set this again
if ( ! NamingManager . hasInitialContextFactoryBuilder ( ) ) NamingManager . setInitialContextFactoryBuilder ( new InitialContextFactoryBuilder ( ) ) ; } catch ( NamingException e ) { ROOT_LOGGER . failedToSet ( e , "InitialContextFactoryBuilder" ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void bind ( final Name name , final Object object ) throws NamingException { } }

implementation:
check ( name , JndiPermission . ACTION_BIND ) ; if ( namingStore instanceof WritableNamingStore ) { final Name absoluteName = getAbsoluteName ( name ) ; final Object value ; if ( object instanceof Referenceable ) { value = ( ( Referenceable ) object ) . getReference ( ) ; } else { value = object ; } if ( System . getSecurityManager ( ) == null ) { getWritableNamingStore ( ) . bind ( absoluteName , value ) ; } else { // The permissions check has already happened for the binding further permissions should be allowed
final NamingException e = AccessController . doPrivileged ( new PrivilegedAction < NamingException > ( ) { @ Override public NamingException run ( ) { try { getWritableNamingStore ( ) . bind ( absoluteName , value ) ; } catch ( NamingException e ) { return e ; } return null ; } } ) ; // Check that a NamingException wasn ' t thrown during the bind
if ( e != null ) { throw e ; } } } else { throw NamingLogger . ROOT_LOGGER . readOnlyNamingContext ( ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void bind ( final String name , final Object obj ) throws NamingException { } }

implementation: bind ( parseName ( name ) , obj ) ;


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void rebind ( final Name name , Object object ) throws NamingException { } }

implementation: check ( name , JndiPermission . ACTION_REBIND ) ; if ( namingStore instanceof WritableNamingStore ) { final Name absoluteName = getAbsoluteName ( name ) ; if ( object instanceof Referenceable ) { object = ( ( Referenceable ) object ) . getReference ( ) ; } getWritableNamingStore ( ) . rebind ( absoluteName , object ) ; } else { throw NamingLogger . ROOT_LOGGER . readOnlyNamingContext ( ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void rebind ( final String name , final Object object ) throws NamingException { } }

implementation: rebind ( parseName ( name ) , object ) ;


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void unbind ( final Name name ) throws NamingException { } }

implementation: check ( name , JndiPermission . ACTION_UNBIND ) ; if ( namingStore instanceof WritableNamingStore ) { final Name absoluteName = getAbsoluteName ( name ) ; getWritableNamingStore ( ) . unbind ( absoluteName ) ; } else { throw NamingLogger . ROOT_LOGGER . readOnlyNamingContext ( ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void rename ( final Name oldName , final Name newName ) throws NamingException { } }

implementation:
// check for appropriate permissions first so that no other info leaks from this context
// in case of insufficient perms ( like the fact if it is readonly or not )
check ( oldName , JndiPermission . ACTION_LOOKUP | JndiPermission . ACTION_UNBIND ) ; check ( newName , JndiPermission . ACTION_BIND ) ; if ( namingStore instanceof WritableNamingStore ) { bind ( newName , lookup ( oldName ) ) ; unbind ( oldName ) ; } else { throw NamingLogger . ROOT_LOGGER . readOnlyNamingContext ( ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void rename ( final String oldName , final String newName ) throws NamingException { } }

implementation: rename ( parseName ( oldName ) , parseName ( newName ) ) ;


signature:
public class NamingContext { /** * { @ inheritDoc } */
public NamingEnumeration < NameClassPair > list ( final Name name ) throws NamingException { } }

implementation: check ( name , JndiPermission . ACTION_LIST ) ; try { return namingEnumeration ( namingStore . list ( getAbsoluteName ( name ) ) ) ; } catch ( CannotProceedException cpe ) { final Context continuationContext = NamingManager . getContinuationContext ( cpe ) ; return continuationContext . list ( cpe . getRemainingName ( ) ) ; } catch ( RequireResolveException r ) { final Object o = lookup ( r . getResolve ( ) ) ; if ( o instanceof Context ) { return ( ( Context ) o ) . list ( name . getSuffix ( r . getResolve ( ) . size ( ) ) ) ; } throw notAContextException ( r . getResolve ( ) ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void destroySubcontext ( final Name name ) throws NamingException { } }

implementation: check ( name , JndiPermission . ACTION_DESTROY_SUBCONTEXT ) ; if ( ! ( namingStore instanceof WritableNamingStore ) ) { throw NamingLogger . ROOT_LOGGER . readOnlyNamingContext ( ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public Context createSubcontext ( Name name ) throws NamingException { } }

implementation: check ( name , JndiPermission . ACTION_CREATE_SUBCONTEXT ) ; if ( namingStore instanceof WritableNamingStore ) { final Name absoluteName = getAbsoluteName ( name ) ; return getWritableNamingStore ( ) . createSubcontext ( absoluteName ) ; } else { throw NamingLogger . ROOT_LOGGER . readOnlyNamingContext ( ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public Object lookupLink ( Name name ) throws NamingException { } }

implementation: check ( name , JndiPermission . ACTION_LOOKUP ) ; if ( name . isEmpty ( ) ) { return lookup ( name ) ; } try { final Name absoluteName = getAbsoluteName ( name ) ; Object link = namingStore . lookup ( absoluteName ) ; if ( ! ( link instanceof LinkRef ) && link instanceof Reference ) { link = getObjectInstance ( link , name , null ) ; } return link ; } catch ( Exception e ) { throw namingException ( NamingLogger . ROOT_LOGGER . cannotLookupLink ( ) , e , name ) ; }


signature:
public class NamingContext { /** * { @ inheritDoc } */
public Name composeName ( Name name , Name prefix ) throws NamingException { } }

implementation:
final Name result = ( Name ) prefix . clone ( ) ; if ( name instanceof CompositeName ) { if ( name . size ( ) == 1 ) { // name could be a nested name
final String firstComponent = name . get ( 0 ) ; result . addAll ( parseName ( firstComponent ) ) ; } else { result . addAll ( name ) ; } } else { result . addAll ( new CompositeName ( name . toString ( ) ) ) ; } return result ;


signature:
public class NamingContext { /** * { @ inheritDoc } */
public String composeName ( String name , String prefix ) throws NamingException { } }

implementation: return composeName ( parseName ( name ) , parseName ( prefix ) ) . toString ( ) ;


signature:
public class NamingContext { /** * { @ inheritDoc } */
public Object addToEnvironment ( String propName , Object propVal ) throws NamingException { } }

implementation: final Object existing = environment . get ( propName ) ; environment . put ( propName , propVal ) ; return existing ;


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void addNamingListener ( final Name target , final int scope , final NamingListener listener ) throws NamingException { } }

implementation: check ( target , JndiPermission . ACTION_ADD_NAMING_LISTENER ) ; namingStore . addNamingListener ( target , scope , listener ) ;


signature:
public class NamingContext { /** * { @ inheritDoc } */
public void addNamingListener ( final String target , final int scope , final NamingListener listener ) throws NamingException { } }

implementation: addNamingListener ( parseName ( target ) , scope , listener ) ;


signature:
public class NamespaceConfigurator { /** * { @ inheritDoc } */
public void configure ( final DeploymentPhaseContext context , final ComponentDescription description , final ComponentConfiguration configuration ) throws DeploymentUnitProcessingException { } }

implementation: final ComponentNamingMode namingMode = description . getNamingMode ( ) ; final InjectedEENamespaceContextSelector selector = new InjectedEENamespaceContextSelector ( ) ; final String applicationName = configuration . getApplicationName ( ) ; final String moduleName = configuration . getModuleName ( ) ; final String compName = configuration . getComponentName ( ) ; final ServiceName appContextServiceName = ContextNames . contextServiceNameOfApplication ( applicationName ) ; final ServiceName moduleContextServiceName = ContextNames . contextServiceNameOfModule ( applicationName , moduleName ) ; final ServiceName compContextServiceName = ContextNames . contextServiceNameOfComponent ( applicationName , moduleName , compName ) ; final Injector < NamingStore > appInjector = selector . getAppContextInjector ( ) ; final Injector < NamingStore > moduleInjector = selector . getModuleContextInjector ( ) ; final Injector < NamingStore > compInjector = selector . getCompContextInjector ( ) ; final Injector < NamingStore > jbossInjector = selector . getJbossContextInjector ( ) ; final Injector < NamingStore > globalInjector = selector . getGlobalContextInjector ( ) ; final Injector < NamingStore > exportedInjector = selector . getExportedContextInjector ( ) ; configuration . getStartDependencies ( ) . add ( new DependencyConfigurator < ComponentStartService > ( ) { public void configureDependency ( final ServiceBuilder < ? > serviceBuilder , ComponentStartService service ) { serviceBuilder . addDependency ( appContextServiceName , NamingStore . class , appInjector ) ; serviceBuilder . addDependency ( moduleContextServiceName , NamingStore . class , moduleInjector ) ; if ( namingMode == ComponentNamingMode . CREATE ) { serviceBuilder . addDependency ( compContextServiceName , NamingStore . class , compInjector ) ; } else if ( namingMode == ComponentNamingMode . USE_MODULE ) { serviceBuilder . addDependency ( moduleContextServiceName , NamingStore . class , compInjector ) ; } serviceBuilder . addDependency ( ContextNames . GLOBAL_CONTEXT_SERVICE_NAME , NamingStore . class , globalInjector ) ; serviceBuilder . addDependency ( ContextNames . JBOSS_CONTEXT_SERVICE_NAME , NamingStore . class , jbossInjector ) ; serviceBuilder . addDependency ( ContextNames . EXPORTED_CONTEXT_SERVICE_NAME , NamingStore . class , exportedInjector ) ; } } ) ; final InterceptorFactory interceptorFactory = new ImmediateInterceptorFactory ( new NamespaceContextInterceptor ( selector , context . getDeploymentUnit ( ) . getServiceName ( ) ) ) ; configuration . addPostConstructInterceptor ( interceptorFactory , InterceptorOrder . ComponentPostConstruct . JNDI_NAMESPACE_INTERCEPTOR ) ; configuration . addPreDestroyInterceptor ( interceptorFactory , InterceptorOrder . ComponentPreDestroy . JNDI_NAMESPACE_INTERCEPTOR ) ; if ( description . isPassivationApplicable ( ) ) { configuration . addPrePassivateInterceptor ( interceptorFactory , InterceptorOrder . ComponentPassivation . JNDI_NAMESPACE_INTERCEPTOR ) ; configuration . addPostActivateInterceptor ( interceptorFactory , InterceptorOrder . ComponentPassivation . JNDI_NAMESPACE_INTERCEPTOR ) ; } configuration . setNamespaceContextInterceptorFactory ( interceptorFactory ) ; configuration . setNamespaceContextSelector ( selector ) ;


signature:
public class WebContainerDefinition { /** * { @ inheritDoc }
 * Registers an add operation handler or a remove operation handler if one was provided to the constructor . */
@ Override public void registerOperations ( ManagementResourceRegistration container ) { } }

implementation: super . registerOperations ( container ) ; container . registerOperationHandler ( ADD_MIME , MimeMappingAdd . INSTANCE ) ; container . registerOperationHandler ( REMOVE_MIME , MimeMappingRemove . INSTANCE ) ;


signature:
public class JaxrsMethodParameterProcessor { /** * Process all parameter DefaulValue objects . Flag all parameters with
 * missing and invalid converters .
 * @ param detailList
 * @ param paramConverterMap */
private void validateDefaultValues ( List < ParamDetail > detailList , HashMap < String , List < Validator > > paramConverterMap ) throws DeploymentUnitProcessingException { } }

implementation:
for ( ParamDetail detail : detailList ) { // check param converter for specific return type
List < Validator > validators = paramConverterMap . get ( detail . parameter . getName ( ) ) ; if ( validators == null ) { // check for paramConverterProvider
validators = paramConverterMap . get ( Object . class . getName ( ) ) ; } boolean isCheckClazzMethods = true ; if ( validators != null ) { for ( Validator v : validators ) { if ( ! v . isLazyLoad ( ) ) { try { Object obj = v . verify ( detail ) ; if ( obj != null ) { isCheckClazzMethods = false ; break ; } } catch ( Exception e ) { JAXRS_LOGGER . paramConverterFailed ( detail . defaultValue . value ( ) , detail . parameter . getSimpleName ( ) , detail . method . toString ( ) , v . toString ( ) , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } } } if ( isCheckClazzMethods ) { Class baseType = detail . parameter ; Method valueOf = null ; // constructor rule
try { Constructor < ? > ctor = baseType . getConstructor ( String . class ) ; if ( Modifier . isPublic ( ctor . getModifiers ( ) ) ) { continue ; // success move to next detail
} } catch ( NoSuchMethodException ignored ) { } // method fromValue ( String . class ) rule
try { Method fromValue = baseType . getDeclaredMethod ( "fromValue" , String . class ) ; if ( Modifier . isPublic ( fromValue . getModifiers ( ) ) ) { for ( Annotation ann : baseType . getAnnotations ( ) ) { if ( ann . annotationType ( ) . getName ( ) . equals ( "javax.xml.bind.annotation.XmlEnum" ) ) { valueOf = fromValue ; } } validateBaseType ( fromValue , detail . defaultValue . value ( ) , detail ) ; continue ; // success move to next detail
} } catch ( NoSuchMethodException ignoredA ) { } // method fromString ( String . class ) rule
Method fromString = null ; try { fromString = baseType . getDeclaredMethod ( "fromString" , String . class ) ; if ( Modifier . isStatic ( fromString . getModifiers ( ) ) ) { validateBaseType ( fromString , detail . defaultValue . value ( ) , detail ) ; continue ; // success move to next detail
} } catch ( NoSuchMethodException ignoredB ) { } // method valueof ( String . class ) rule
try { valueOf = baseType . getDeclaredMethod ( "valueOf" , String . class ) ; if ( Modifier . isStatic ( valueOf . getModifiers ( ) ) ) { validateBaseType ( valueOf , detail . defaultValue . value ( ) , detail ) ; continue ; // success move to next detail
} } catch ( NoSuchMethodException ignored ) { } } }


signature:
public class JaxrsMethodParameterProcessor { /** * Create a list of ParamConverters and ParamConverterProviders present
 * in the application .
 * When running unitTest the classes must be indexed . In normal deployment
 * the indexing is already done .
 * @ param index
 * @ param classLoader
 * @ return */
private HashMap < String , List < Validator > > getParamConverters ( final CompositeIndex index , final ClassLoader classLoader , Set < String > knownProviderClasses , boolean isFromUnitTest ) { } }

implementation: HashMap < String , List < Validator > > paramConverterMap = new HashMap < > ( ) ; List < Validator > converterProviderList = new ArrayList < > ( ) ; paramConverterMap . put ( Object . class . getName ( ) , converterProviderList ) ; Set < ClassInfo > paramConverterSet = new HashSet < ClassInfo > ( ) ; if ( isFromUnitTest ) { Indexer indexer = new Indexer ( ) ; for ( String className : knownProviderClasses ) { try { String pathName = className . replace ( "." , File . separator ) ; InputStream stream = classLoader . getResourceAsStream ( pathName + ".class" ) ; indexer . index ( stream ) ; stream . close ( ) ; } catch ( IOException e ) { JAXRS_LOGGER . classIntrospectionFailure ( e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } List < ClassInfo > paramConverterList = indexer . complete ( ) . getKnownDirectImplementors ( PARAM_CONVERTER_DOTNAME ) ; List < ClassInfo > paramConverterProviderList = indexer . complete ( ) . getKnownDirectImplementors ( PARAM_CONVERTER_PROVIDER_DOTNAME ) ; paramConverterSet . addAll ( paramConverterList ) ; paramConverterSet . addAll ( paramConverterProviderList ) ; } else { for ( String clazzName : knownProviderClasses ) { ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( clazzName ) ) ; if ( classInfo != null ) { List < DotName > intfNamesList = classInfo . interfaceNames ( ) ; for ( DotName dotName : intfNamesList ) { if ( dotName . compareTo ( PARAM_CONVERTER_DOTNAME ) == 0 || dotName . compareTo ( PARAM_CONVERTER_PROVIDER_DOTNAME ) == 0 ) { paramConverterSet . add ( classInfo ) ; break ; } } } } } for ( ClassInfo classInfo : paramConverterSet ) { Class < ? > clazz = null ; Method method = null ; try { String clazzName = classInfo . name ( ) . toString ( ) ; if ( clazzName . endsWith ( "$1" ) ) { clazzName = clazzName . substring ( 0 , clazzName . length ( ) - 2 ) ; } clazz = classLoader . loadClass ( clazzName ) ; Constructor < ? > ctor = clazz . getConstructor ( ) ; Object object = ctor . newInstance ( ) ; List < AnnotationInstance > lazyLoadAnnotations = classInfo . annotations ( ) . get ( PARAM_CONVERTER_LAZY_DOTNAME ) ; if ( object instanceof ParamConverterProvider ) { ParamConverterProvider pcpObj = ( ParamConverterProvider ) object ; method = pcpObj . getClass ( ) . getMethod ( "getConverter" , Class . class , Type . class , Annotation [ ] . class ) ; converterProviderList . add ( new ConverterProvider ( pcpObj , method , lazyLoadAnnotations ) ) ; } if ( object instanceof ParamConverter ) { ParamConverter pc = ( ParamConverter ) object ; method = getFromStringMethod ( pc . getClass ( ) ) ; Class < ? > returnClazz = method . getReturnType ( ) ; List < Validator > verifiers = paramConverterMap . get ( returnClazz . getName ( ) ) ; PConverter pConverter = new PConverter ( pc , method , lazyLoadAnnotations ) ; if ( verifiers == null ) { List < Validator > vList = new ArrayList < > ( ) ; vList . add ( pConverter ) ; paramConverterMap . put ( returnClazz . getName ( ) , vList ) ; } else { verifiers . add ( pConverter ) ; } } } catch ( NoSuchMethodException nsne ) { JAXRS_LOGGER . classIntrospectionFailure ( nsne . getClass ( ) . getName ( ) , nsne . getMessage ( ) ) ; } catch ( Exception e ) { JAXRS_LOGGER . classIntrospectionFailure ( e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } return paramConverterMap ;


signature:
public class JaxrsMethodParameterProcessor { /** * Create list of objects that represents resource method parameters with a
 * DefaultValue annontation assigned to it .
 * When running unitTest the classes must be indexed . In normal deployment
 * the indexing is already done .
 * @ param index
 * @ param classLoader
 * @ return */
private ArrayList < ParamDetail > getResouceClasses ( final CompositeIndex index , final ClassLoader classLoader , Set < String > knownResourceClasses , boolean isFromUnitTest ) { } }

implementation:
ArrayList < ParamDetail > detailList = new ArrayList < > ( ) ; ArrayList < String > classNameArr = new ArrayList < > ( ) ; if ( isFromUnitTest ) { Indexer indexer = new Indexer ( ) ; for ( String className : knownResourceClasses ) { try { String pathName = className . replace ( "." , File . separator ) ; InputStream stream = classLoader . getResourceAsStream ( pathName + ".class" ) ; ClassInfo classInfo = indexer . index ( stream ) ; List < AnnotationInstance > defaultValuesList = classInfo . annotations ( ) . get ( DEFAULT_VALUE_DOTNAME ) ; if ( ! defaultValuesList . isEmpty ( ) ) { classNameArr . add ( ( classInfo ) . name ( ) . toString ( ) ) ; } stream . close ( ) ; } catch ( IOException e ) { JAXRS_LOGGER . classIntrospectionFailure ( e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } } else { for ( String clazzName : knownResourceClasses ) { ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( clazzName ) ) ; if ( classInfo != null ) { Map < DotName , List < AnnotationInstance > > annotationsMap = classInfo . annotations ( ) ; if ( annotationsMap != null && ! annotationsMap . isEmpty ( ) ) { List < AnnotationInstance > xInstance = annotationsMap . get ( JaxrsAnnotations . PATH . getDotName ( ) ) ; List < AnnotationInstance > xdefaultValuesList = annotationsMap . get ( DEFAULT_VALUE_DOTNAME ) ; if ( ( xInstance != null && ! xInstance . isEmpty ( ) ) && ( xdefaultValuesList != null && ! xdefaultValuesList . isEmpty ( ) ) ) { classNameArr . add ( ( classInfo ) . name ( ) . toString ( ) ) ; } } } } } // resource classes with @ DefaultValue
// find methods and method params with @ DefaultValue
for ( String className : classNameArr ) { Class < ? > clazz = null ; try { clazz = classLoader . loadClass ( className ) ; for ( Method method : clazz . getMethods ( ) ) { if ( clazz == method . getDeclaringClass ( ) ) { Type [ ] genParamTypeArr = method . getGenericParameterTypes ( ) ; Annotation [ ] [ ] annotationMatrix = method . getParameterAnnotations ( ) ; for ( int j = 0 ; j < genParamTypeArr . length ; j ++ ) { DefaultValue defaultValue = lookupDefaultValueAnn ( annotationMatrix [ j ] ) ; if ( defaultValue != null ) { Class paramClazz = checkParamType ( genParamTypeArr [ j ] , method , j , classLoader ) ; if ( paramClazz != null ) { detailList . add ( new ParamDetail ( method , defaultValue , paramClazz , annotationMatrix [ j ] ) ) ; } } } } } } catch ( ClassNotFoundException e ) { JAXRS_LOGGER . classIntrospectionFailure ( e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } return detailList ;


signature:
public class JaxrsMethodParameterProcessor { /** * Take steps to properly identify the parameter ' s data type
 * @ param genParamType
 * @ param method
 * @ param paramPos
 * @ param classLoader
 * @ return */
private Class checkParamType ( Type genParamType , final Method method , final int paramPos , final ClassLoader classLoader ) { } }

implementation:
Class paramClazz = null ; if ( genParamType instanceof ParameterizedType ) { ParameterizedType pType = ( ParameterizedType ) genParamType ; Type [ ] actualTypeArgs = pType . getActualTypeArguments ( ) ; // skip Map types . Don ' t know how to set default value for these
if ( actualTypeArgs . length == 1 ) { try { paramClazz = classLoader . loadClass ( actualTypeArgs [ 0 ] . getTypeName ( ) ) ; } catch ( Exception ee ) { JAXRS_LOGGER . classIntrospectionFailure ( ee . getClass ( ) . getName ( ) , ee . getMessage ( ) ) ; } } } else { Class < ? > [ ] paramArr = method . getParameterTypes ( ) ; if ( paramArr [ paramPos ] . isArray ( ) ) { Class compClazz = paramArr [ paramPos ] . getComponentType ( ) ; if ( ! compClazz . isPrimitive ( ) ) { paramClazz = compClazz ; } } else { if ( ! paramArr [ paramPos ] . isPrimitive ( ) ) { paramClazz = paramArr [ paramPos ] ; } } } return paramClazz ;


signature:
public class JaxrsMethodParameterProcessor { /** * Extract a DefaultValue annotation from the list of parameter annotations
 * @ param annotationArr
 * @ return */
private DefaultValue lookupDefaultValueAnn ( Annotation [ ] annotationArr ) { } }

implementation: for ( Annotation ann : annotationArr ) { if ( ann instanceof DefaultValue ) { return ( DefaultValue ) ann ; } } return null ;


signature:
public class JaxrsMethodParameterProcessor { /** * Confirm the method can handle the default value without throwing
 * and exception .
 * @ param method
 * @ param defaultValue */
private void validateBaseType ( Method method , String defaultValue , ParamDetail detail ) throws DeploymentUnitProcessingException { } }

implementation: if ( defaultValue != null ) { try { method . invoke ( method . getDeclaringClass ( ) , defaultValue ) ; } catch ( Exception e ) { JAXRS_LOGGER . baseTypeMethodFailed ( defaultValue , detail . parameter . getSimpleName ( ) , detail . method . toString ( ) , method . toString ( ) , e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } }


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

implementation: final boolean registerRuntimeOnly = context . isRuntimeOnlyRegistrationValid ( ) ; final SubsystemRegistration subsystem = context . registerSubsystem ( SUBSYSTEM_NAME , CURRENT_MODEL_VERSION ) ; subsystem . registerXMLElementWriter ( EJB3SubsystemXMLPersister . INSTANCE ) ; PathManager pathManager = context . getProcessType ( ) . isServer ( ) ? context . getPathManager ( ) : null ; subsystem . registerSubsystemModel ( new EJB3SubsystemRootResourceDefinition ( registerRuntimeOnly , pathManager ) ) ; if ( registerRuntimeOnly ) { ResourceDefinition deploymentsDef = new SimpleResourceDefinition ( new Parameters ( PathElement . pathElement ( ModelDescriptionConstants . SUBSYSTEM , SUBSYSTEM_NAME ) , getResourceDescriptionResolver ( "deployed" ) ) . setFeature ( false ) ) ; final ManagementResourceRegistration deploymentsRegistration = subsystem . registerDeploymentModel ( deploymentsDef ) ; deploymentsRegistration . registerSubModel ( MessageDrivenBeanResourceDefinition . INSTANCE ) ; deploymentsRegistration . registerSubModel ( SingletonBeanDeploymentResourceDefinition . INSTANCE ) ; deploymentsRegistration . registerSubModel ( StatelessSessionBeanDeploymentResourceDefinition . INSTANCE ) ; deploymentsRegistration . registerSubModel ( StatefulSessionBeanDeploymentResourceDefinition . INSTANCE ) ; }


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

implementation: context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_0 , EJB3Subsystem10Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_1 , EJB3Subsystem11Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_2 , EJB3Subsystem12Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_3 , EJB3Subsystem13Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_4 , EJB3Subsystem14Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_1_5 , EJB3Subsystem15Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_2_0 , EJB3Subsystem20Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_3_0 , EJB3Subsystem30Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_4_0 , EJB3Subsystem40Parser :: new ) ; context . setSubsystemXmlMapping ( SUBSYSTEM_NAME , NAMESPACE_5_0 , EJB3Subsystem50Parser :: new ) ;


signature:
public class CreatedEntityManagers { /** * At injection time of a XPC , register the XPC ( step 1 of 2)
 * finishRegistrationOfPersistenceContext is step 2
 * @ param xpc The ExtendedEntityManager */
public static void registerPersistenceContext ( ExtendedEntityManager xpc ) { } }

implementation: if ( xpc == null ) { throw JpaLogger . ROOT_LOGGER . nullParameter ( "SFSBXPCMap.RegisterPersistenceContext" , "EntityManager" ) ; } final List < ExtendedEntityManager > store = deferToPostConstruct . get ( ) ; store . add ( xpc ) ;


signature:
public class CreatedEntityManagers { /** * Called by postconstruct interceptor */
public static ExtendedEntityManager [ ] getDeferredEntityManagers ( ) { } }

implementation: List < ExtendedEntityManager > store = deferToPostConstruct . get ( ) ; try { if ( store . isEmpty ( ) ) { return EMPTY ; } else { return store . toArray ( new ExtendedEntityManager [ store . size ( ) ] ) ; } } finally { store . clear ( ) ; }


signature:
public class StatusHelper { /** * Converts a tx Status index to a String
 * @ param status the Status index
 * @ return status as String or " STATUS _ INVALID ( value ) "
 * @ see javax . transaction . Status */
public static String statusAsString ( int status ) { } }

implementation: if ( status >= Status . STATUS_ACTIVE && status <= Status . STATUS_ROLLING_BACK ) { return TxStatusStrings [ status ] ; } else { return "STATUS_INVALID(" + status + ")" ; }


signature:
public class ServerAdd { /** * Check that none of the attrs are defined , or log a warning . */
private void checkNoAttributesIsDefined ( String definedAttributeName , PathAddress address , ModelNode model , AttributeDefinition ... attrs ) throws OperationFailedException { } }

implementation: List < String > definedAttributes = new ArrayList < > ( ) ; for ( AttributeDefinition attr : attrs ) { if ( model . get ( attr . getName ( ) ) . isDefined ( ) ) { definedAttributes . add ( attr . getName ( ) ) ; } } if ( ! definedAttributes . isEmpty ( ) ) { MessagingLogger . ROOT_LOGGER . invalidConfiguration ( address , definedAttributeName , definedAttributes ) ; }


signature:
public class Notification { /** * called before call to PersistenceProvider . createContainerEntityManagerFactory ( PersistenceUnit , Map )
 * @ param persistenceUnitMetadata */
public static void beforeEntityManagerFactoryCreate ( Classification cacheType , PersistenceUnitMetadata persistenceUnitMetadata ) { } }

implementation: for ( EventListener eventListener : eventListeners ) { eventListener . beforeEntityManagerFactoryCreate ( cacheType , persistenceUnitMetadata ) ; }


signature:
public class Notification { /** * called after call to PersistenceProvider . createContainerEntityManagerFactory ( PersistenceUnit , Map )
 * @ param persistenceUnitMetadata */
public static void afterEntityManagerFactoryCreate ( Classification cacheType , PersistenceUnitMetadata persistenceUnitMetadata ) { } }

implementation: for ( EventListener eventListener : eventListeners ) { eventListener . afterEntityManagerFactoryCreate ( cacheType , persistenceUnitMetadata ) ; }


signature:
public class Notification { /** * start cache
 * @ param cacheType
 * @ param properties
 * @ return an opaque cache wrapper that is later passed to stopCache */
public static Wrapper startCache ( Classification cacheType , Properties properties ) throws Exception { } }

implementation:
Wrapper result = null ; for ( EventListener eventListener : eventListeners ) { Wrapper value = eventListener . startCache ( cacheType , properties ) ; if ( value != null && result == null ) { result = value ; // return the first non - null wrapper value returned from a listener
} } return result ;


signature:
public class Notification { /** * add cache dependencies
 * @ param properties */
public static void addCacheDependencies ( Classification cacheType , Properties properties ) { } }

implementation: for ( EventListener eventListener : eventListeners ) { eventListener . addCacheDependencies ( cacheType , properties ) ; }


signature:
public class Notification { /** * Stop cache
 * @ param cacheType
 * @ param wrapper */
public static void stopCache ( Classification cacheType , Wrapper wrapper ) { } }

implementation: for ( EventListener eventListener : eventListeners ) { eventListener . stopCache ( cacheType , wrapper ) ; }


signature:
public class TransactionSubsystemXMLPersister { /** * { @ inheritDoc } */
@ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } }

implementation: context . startSubsystemElement ( Namespace . CURRENT . getUriString ( ) , false ) ; ModelNode node = context . getModelNode ( ) ; writer . writeStartElement ( Element . CORE_ENVIRONMENT . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . NODE_IDENTIFIER . marshallAsAttribute ( node , writer ) ; writeProcessId ( writer , node ) ; writer . writeEndElement ( ) ; if ( TransactionSubsystemRootResourceDefinition . BINDING . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . STATUS_BINDING . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . RECOVERY_LISTENER . isMarshallable ( node ) ) { writer . writeStartElement ( Element . RECOVERY_ENVIRONMENT . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . BINDING . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . STATUS_BINDING . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . RECOVERY_LISTENER . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } if ( TransactionSubsystemRootResourceDefinition . STATISTICS_ENABLED . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . ENABLE_TSM_STATUS . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . DEFAULT_TIMEOUT . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . MAXIMUM_TIMEOUT . isMarshallable ( node ) ) { writer . writeStartElement ( Element . COORDINATOR_ENVIRONMENT . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . STATISTICS_ENABLED . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . ENABLE_TSM_STATUS . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . DEFAULT_TIMEOUT . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . MAXIMUM_TIMEOUT . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } if ( TransactionSubsystemRootResourceDefinition . OBJECT_STORE_RELATIVE_TO . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . OBJECT_STORE_PATH . isMarshallable ( node ) ) { writer . writeStartElement ( Element . OBJECT_STORE . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . OBJECT_STORE_PATH . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . OBJECT_STORE_RELATIVE_TO . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } if ( node . hasDefined ( CommonAttributes . JTS ) && node . get ( CommonAttributes . JTS ) . asBoolean ( ) ) { writer . writeStartElement ( Element . JTS . getLocalName ( ) ) ; writer . writeEndElement ( ) ; } if ( node . hasDefined ( CommonAttributes . USE_JOURNAL_STORE ) && node . get ( CommonAttributes . USE_JOURNAL_STORE ) . asBoolean ( ) ) { writer . writeStartElement ( Element . USE_JOURNAL_STORE . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . JOURNAL_STORE_ENABLE_ASYNC_IO . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } if ( node . hasDefined ( CommonAttributes . USE_JDBC_STORE ) && node . get ( CommonAttributes . USE_JDBC_STORE ) . asBoolean ( ) ) { writer . writeStartElement ( Element . JDBC_STORE . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . JDBC_STORE_DATASOURCE . marshallAsAttribute ( node , writer ) ; if ( TransactionSubsystemRootResourceDefinition . JDBC_ACTION_STORE_TABLE_PREFIX . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . JDBC_ACTION_STORE_DROP_TABLE . isMarshallable ( node ) ) { writer . writeEmptyElement ( Element . JDBC_ACTION_STORE . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . JDBC_ACTION_STORE_TABLE_PREFIX . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . JDBC_ACTION_STORE_DROP_TABLE . marshallAsAttribute ( node , writer ) ; } if ( TransactionSubsystemRootResourceDefinition . JDBC_COMMUNICATION_STORE_TABLE_PREFIX . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . JDBC_COMMUNICATION_STORE_DROP_TABLE . isMarshallable ( node ) ) { writer . writeEmptyElement ( Element . JDBC_COMMUNICATION_STORE . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . JDBC_COMMUNICATION_STORE_TABLE_PREFIX . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . JDBC_COMMUNICATION_STORE_DROP_TABLE . marshallAsAttribute ( node , writer ) ; } if ( TransactionSubsystemRootResourceDefinition . JDBC_STATE_STORE_TABLE_PREFIX . isMarshallable ( node ) || TransactionSubsystemRootResourceDefinition . JDBC_STATE_STORE_DROP_TABLE . isMarshallable ( node ) ) { writer . writeEmptyElement ( Element . JDBC_STATE_STORE . getLocalName ( ) ) ; TransactionSubsystemRootResourceDefinition . JDBC_STATE_STORE_TABLE_PREFIX . marshallAsAttribute ( node , writer ) ; TransactionSubsystemRootResourceDefinition . JDBC_STATE_STORE_DROP_TABLE . marshallAsAttribute ( node , writer ) ; } writer . writeEndElement ( ) ; } if ( node . hasDefined ( CommonAttributes . CM_RESOURCE ) && node . get ( CommonAttributes . CM_RESOURCE ) . asList ( ) . size ( ) > 0 ) { writer . writeStartElement ( Element . CM_RESOURCES . getLocalName ( ) ) ; for ( Property cmr : node . get ( CommonAttributes . CM_RESOURCE ) . asPropertyList ( ) ) { writer . writeStartElement ( CommonAttributes . CM_RESOURCE ) ; writer . writeAttribute ( Attribute . JNDI_NAME . getLocalName ( ) , cmr . getName ( ) ) ; if ( cmr . getValue ( ) . hasDefined ( CMResourceResourceDefinition . CM_TABLE_NAME . getName ( ) ) || cmr . getValue ( ) . hasDefined ( CMResourceResourceDefinition . CM_TABLE_BATCH_SIZE . getName ( ) ) || cmr . getValue ( ) . hasDefined ( CMResourceResourceDefinition . CM_TABLE_IMMEDIATE_CLEANUP . getName ( ) ) ) { writer . writeStartElement ( Element . CM_TABLE . getLocalName ( ) ) ; CMResourceResourceDefinition . CM_TABLE_NAME . marshallAsAttribute ( cmr . getValue ( ) , writer ) ; CMResourceResourceDefinition . CM_TABLE_BATCH_SIZE . marshallAsAttribute ( cmr . getValue ( ) , writer ) ; CMResourceResourceDefinition . CM_TABLE_IMMEDIATE_CLEANUP . marshallAsAttribute ( cmr . getValue ( ) , writer ) ; writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ;


signature:
public class DatabaseTimerPersistence { /** * Read the properties from the timer - sql and extract the database dialects . */
private void extractDialects ( ) { } }

implementation: for ( Object prop : sql . keySet ( ) ) { int dot = ( ( String ) prop ) . indexOf ( '.' ) ; if ( dot > 0 ) { databaseDialects . add ( ( ( String ) prop ) . substring ( dot + 1 ) ) ; } }


signature:
public class DatabaseTimerPersistence { /** * Check the connection MetaData and driver name to guess which database dialect
 * to use . */
private void investigateDialect ( ) { } }

implementation:
Connection connection = null ; if ( database == null ) { // no database dialect from configuration guessing from MetaData
try { connection = dataSource . getConnection ( ) ; DatabaseMetaData metaData = connection . getMetaData ( ) ; String dbProduct = metaData . getDatabaseProductName ( ) ; database = identifyDialect ( dbProduct ) ; if ( database == null ) { EjbLogger . EJB3_TIMER_LOGGER . debug ( "Attempting to guess on driver name." ) ; database = identifyDialect ( metaData . getDriverName ( ) ) ; } } catch ( Exception e ) { EjbLogger . EJB3_TIMER_LOGGER . debug ( "Unable to read JDBC metadata." , e ) ; } finally { safeClose ( connection ) ; } if ( database == null ) { EjbLogger . EJB3_TIMER_LOGGER . jdbcDatabaseDialectDetectionFailed ( databaseDialects . toString ( ) ) ; } else { EjbLogger . EJB3_TIMER_LOGGER . debugf ( "Detect database dialect as '%s'.  If this is incorrect, please specify the correct dialect using the 'database' attribute in your configuration.  Supported database dialect strings are %s" , database , databaseDialects ) ; } } else { EjbLogger . EJB3_TIMER_LOGGER . debugf ( "Database dialect '%s' read from configuration, adjusting it to match the final database valid value." , database ) ; database = identifyDialect ( database ) ; EjbLogger . EJB3_TIMER_LOGGER . debugf ( "New Database dialect is '%s'." , database ) ; }


signature:
public class DatabaseTimerPersistence { /** * Use the given name and check for different database types to have a unified identifier for the dialect
 * @ param name A database name or even a driver name which should include the database name
 * @ return A unified dialect identifier */
private String identifyDialect ( String name ) { } }

implementation: String unified = null ; if ( name != null ) { if ( name . toLowerCase ( ) . contains ( "postgres" ) ) { unified = "postgresql" ; } else if ( name . toLowerCase ( ) . contains ( "mysql" ) ) { unified = "mysql" ; } else if ( name . toLowerCase ( ) . contains ( "mariadb" ) ) { unified = "mariadb" ; } else if ( name . toLowerCase ( ) . contains ( "db2" ) ) { unified = "db2" ; } else if ( name . toLowerCase ( ) . contains ( "hsql" ) || name . toLowerCase ( ) . contains ( "hypersonic" ) ) { unified = "hsql" ; } else if ( name . toLowerCase ( ) . contains ( "h2" ) ) { unified = "h2" ; } else if ( name . toLowerCase ( ) . contains ( "oracle" ) ) { unified = "oracle" ; } else if ( name . toLowerCase ( ) . contains ( "microsoft" ) ) { unified = "mssql" ; } else if ( name . toLowerCase ( ) . contains ( "jconnect" ) ) { unified = "sybase" ; } } EjbLogger . EJB3_TIMER_LOGGER . debugf ( "Check dialect for '%s', result is '%s'" , name , unified ) ; return unified ;


signature:
public class DatabaseTimerPersistence { /** * Checks whether the database transaction configuration is appropriate
 * and create the timer table if necessary . */
private void checkDatabase ( ) { } }

implementation:
String loadTimer = sql ( LOAD_TIMER ) ; Connection connection = null ; Statement statement = null ; PreparedStatement preparedStatement = null ; ResultSet resultSet = null ; try { // test for the existence of the table by running the load timer query
connection = dataSource . getConnection ( ) ; if ( connection . getTransactionIsolation ( ) < Connection . TRANSACTION_READ_COMMITTED ) { EjbLogger . EJB3_TIMER_LOGGER . wrongTransactionIsolationConfiguredForTimer ( ) ; } preparedStatement = connection . prepareStatement ( loadTimer ) ; preparedStatement . setString ( 1 , "NON-EXISTENT" ) ; preparedStatement . setString ( 2 , "NON-EXISTENT" ) ; preparedStatement . setString ( 3 , "NON-EXISTENT" ) ; resultSet = preparedStatement . executeQuery ( ) ; } catch ( SQLException e ) { // the query failed , assume it is because the table does not exist
if ( connection != null ) { try { String createTable = sql ( CREATE_TABLE ) ; String [ ] statements = createTable . split ( ";" ) ; for ( final String sql : statements ) { try { statement = connection . createStatement ( ) ; statement . executeUpdate ( sql ) ; } finally { safeClose ( statement ) ; } } } catch ( SQLException e1 ) { EjbLogger . EJB3_TIMER_LOGGER . couldNotCreateTable ( e1 ) ; } } else { EjbLogger . EJB3_TIMER_LOGGER . couldNotCreateTable ( e ) ; } } finally { safeClose ( resultSet ) ; safeClose ( preparedStatement ) ; safeClose ( statement ) ; safeClose ( connection ) ; }


signature:
public class DatabaseTimerPersistence { /** * Convert the stored date - string from database back to Date */
private Date stringAsSchedulerDate ( final String date , final String timerId ) { } }

implementation: if ( date == null ) { return null ; } try { return new SimpleDateFormat ( SCHEDULER_DATE_FORMAT ) . parse ( date ) ; } catch ( ParseException e ) { EjbLogger . EJB3_TIMER_LOGGER . scheduleExpressionDateFromTimerPersistenceInvalid ( timerId , e . getMessage ( ) ) ; return null ; }


signature:
public class DatabaseTimerPersistence { /** * Set the node name for persistence if the state is IN _ TIMEOUT or RETRY _ TIMEOUT to show which node is current active for the timer . */
private void setNodeName ( final TimerState timerState , PreparedStatement statement , int paramIndex ) throws SQLException { } }

implementation: if ( timerState == TimerState . IN_TIMEOUT || timerState == TimerState . RETRY_TIMEOUT ) { statement . setString ( paramIndex , nodeName ) ; } else { statement . setNull ( paramIndex , Types . VARCHAR ) ; }


signature:
public class WeldDeploymentMarker { /** * Mark this deployment and the top level deployment as being a weld deployment . */
public static void mark ( DeploymentUnit unit ) { } }

implementation: unit . putAttachment ( MARKER , Boolean . TRUE ) ; if ( unit . getParent ( ) != null ) { mark ( unit . getParent ( ) ) ; }


signature:
public class WeldDeploymentMarker { /** * returns true if the { @ link DeploymentUnit } is part of a weld deployment */
public static boolean isPartOfWeldDeployment ( DeploymentUnit unit ) { } }

implementation: if ( unit . getParent ( ) == null ) { return unit . getAttachment ( MARKER ) != null ; } else { return unit . getParent ( ) . getAttachment ( MARKER ) != null ; }


signature:
public class SkeletonStrategy { /** * Unmarshals the sequence of method parameters from an input stream .
 * @ param in a CDR input stream
 * @ return an object array with the parameters . */
public Object [ ] readParams ( InputStream in ) { } }

implementation: int len = paramReaders . length ; Object [ ] params = new Object [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { params [ i ] = paramReaders [ i ] . read ( in ) ; } return params ;


signature:
public class SkeletonStrategy { /** * Marshals into an output stream the return value of the method .
 * @ param out a CDR output stream
 * @ param retVal the value to be written . */
public void writeRetval ( OutputStream out , Object retVal ) { } }

implementation: retvalWriter . write ( out , RemoteObjectSubstitutionManager . writeReplaceRemote ( retVal ) ) ;


signature:
public class SkeletonStrategy { /** * Marshals into an output stream an exception thrown by the method .
 * @ param out a CDR output stream
 * @ param e the exception to be written . */
public void writeException ( OutputStream out , Throwable e ) { } }

implementation: int len = excepWriters . length ; for ( int i = 0 ; i < len ; i ++ ) { if ( excepWriters [ i ] . getExceptionClass ( ) . isInstance ( e ) ) { excepWriters [ i ] . write ( out , e ) ; return ; } } throw new UnknownException ( e ) ;


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

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


signature:
public class OperationDefImpl { /** * ContainedImpl implementation - - - - - */
public Description describe ( ) { } }

implementation: String defined_in_id = "IR" ; if ( defined_in instanceof ContainedOperations ) defined_in_id = ( ( ContainedOperations ) defined_in ) . id ( ) ; ExceptionDescription [ ] exds ; exds = new ExceptionDescription [ exceptions . length ] ; for ( int i = 0 ; i < exceptions . length ; ++ i ) { Description d = exceptions [ i ] . describe ( ) ; exds [ i ] = ExceptionDescriptionHelper . extract ( d . value ) ; } OperationDescription od ; od = new OperationDescription ( name , id , defined_in_id , version , typeCode , mode ( ) , contexts ( ) , params ( ) , exds ) ; Any any = getORB ( ) . create_any ( ) ; OperationDescriptionHelper . insert ( any , od ) ; return new Description ( DefinitionKind . dk_Operation , any ) ;


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

implementation: final PathAddress address = PathAddress . pathAddress ( MailExtension . SUBSYSTEM_PATH ) ; list . add ( Util . createAddOperation ( address ) ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { switch ( Namespace . forUri ( reader . getNamespaceURI ( ) ) ) { case MAIL_1_0 : case MAIL_1_1 : case MAIL_1_2 : { final String element = reader . getLocalName ( ) ; switch ( element ) { case MAIL_SESSION : { parseMailSession ( reader , list , address ) ; break ; } default : { reader . handleAny ( list ) ; break ; } } break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class DefaultBeanInfo { /** * Do lazy lookup .
 * @ param lookup the lookup
 * @ param start the start
 * @ param depth the depth
 * @ return reflection index result */
protected < U > U lookup ( Lookup < U > lookup , int start , int depth ) { } }

implementation: int size ; synchronized ( indexes ) { size = indexes . size ( ) ; for ( int i = start ; i < depth && i < size ; i ++ ) { U result = lookup . lookup ( indexes . get ( i ) ) ; if ( result != null ) return result ; } } if ( currentClass == null ) return null ; synchronized ( indexes ) { ClassReflectionIndex cri = index . getClassIndex ( currentClass ) ; indexes . add ( cri ) ; currentClass = currentClass . getSuperclass ( ) ; } return lookup ( lookup , size , depth ) ;


signature: public class DataSourceDefinitionInjectionSource { @ Override public void getResourceValue ( ResolutionContext context , ServiceBuilder < ? > serviceBuilder , DeploymentPhaseContext phaseContext , Injector < ManagedReferenceFactory > injector ) throws DeploymentUnitProcessingException { } }

implementation:
AgroalConnectionFactoryConfigurationSupplier connectionFactoryConfiguration = new AgroalConnectionFactoryConfigurationSupplier ( ) ; try { Class < ? > providerClass = phaseContext . getDeploymentUnit ( ) . getAttachment ( MODULE ) . getClassLoader ( ) . loadClass ( className ) ; if ( providerClass != null && ! DataSource . class . isAssignableFrom ( providerClass ) && ! Driver . class . isAssignableFrom ( providerClass ) ) { throw AgroalLogger . SERVICE_LOGGER . invalidDeploymentConnectionProvider ( ) ; } connectionFactoryConfiguration . connectionProviderClass ( providerClass ) ; } catch ( ClassNotFoundException e ) { throw AgroalLogger . SERVICE_LOGGER . loadClassDeploymentException ( e , className ) ; } for ( Map . Entry < String , String > property : properties . entrySet ( ) ) { connectionFactoryConfiguration . jdbcProperty ( property . getKey ( ) , property . getValue ( ) ) ; } if ( databaseName != null && ! databaseName . isEmpty ( ) ) { connectionFactoryConfiguration . jdbcProperty ( DATABASE_NAME_PROP , databaseName ) ; } if ( description != null && ! description . isEmpty ( ) ) { connectionFactoryConfiguration . jdbcProperty ( DESCRIPTION_PROP , description ) ; } if ( serverName != null && ! serverName . isEmpty ( ) ) { connectionFactoryConfiguration . jdbcProperty ( SERVER_NAME_PROP , serverName ) ; } if ( portNumber >= 0 ) { connectionFactoryConfiguration . jdbcProperty ( PORT_NUMBER_PROP , Integer . toString ( portNumber ) ) ; } if ( loginTimeout >= 0 ) { connectionFactoryConfiguration . jdbcProperty ( LOGIN_TIMEOUT_PROP , Integer . toString ( loginTimeout ) ) ; } if ( maxStatements >= 0 ) { connectionFactoryConfiguration . jdbcProperty ( MAX_STATEMENTS_PROP , Integer . toString ( maxStatements ) ) ; } if ( url != null && ! url . isEmpty ( ) ) { connectionFactoryConfiguration . jdbcUrl ( url ) ; } if ( user != null && ! user . isEmpty ( ) ) { connectionFactoryConfiguration . principal ( new NamePrincipal ( user ) ) ; } if ( password != null && ! password . isEmpty ( ) ) { connectionFactoryConfiguration . credential ( new SimplePassword ( password ) ) ; } connectionFactoryConfiguration . jdbcTransactionIsolation ( AgroalConnectionFactoryConfiguration . TransactionIsolation . fromLevel ( isolationLevel ) ) ; AgroalConnectionPoolConfigurationSupplier connectionPoolConfiguration = new AgroalConnectionPoolConfigurationSupplier ( ) ; connectionPoolConfiguration . connectionFactoryConfiguration ( connectionFactoryConfiguration ) ; if ( initialPoolSize >= 0 ) { connectionPoolConfiguration . initialSize ( initialPoolSize ) ; } if ( minPoolSize >= 0 ) { connectionPoolConfiguration . minSize ( minPoolSize ) ; } if ( maxPoolSize >= 0 ) { connectionPoolConfiguration . maxSize ( maxPoolSize ) ; } if ( maxIdleTime >= 0 ) { connectionPoolConfiguration . reapTimeout ( Duration . ofSeconds ( maxIdleTime ) ) ; } AgroalDataSourceConfigurationSupplier dataSourceConfiguration = new AgroalDataSourceConfigurationSupplier ( ) ; dataSourceConfiguration . connectionPoolConfiguration ( connectionPoolConfiguration ) ; ContextNames . BindInfo bindInfo = ContextNames . bindInfoForEnvEntry ( context . getApplicationName ( ) , context . getModuleName ( ) , context . getComponentName ( ) , ! context . isCompUsesModule ( ) , jndiName ) ; ServiceName dataSourceServiceName = DATASOURCE_DEFINITION_SERVICE_PREFIX . append ( bindInfo . getBinderServiceName ( ) . getCanonicalName ( ) ) ; // This is the service responsible for the JNDI binding , with a dependency on the datasource service that acts as a ManagedReferenceFactory and is used as the injection source
BinderService binderService = new BinderService ( bindInfo . getBindName ( ) , this ) ; phaseContext . getServiceTarget ( ) . addService ( bindInfo . getBinderServiceName ( ) , binderService ) . addDependency ( dataSourceServiceName , ManagedReferenceFactory . class , binderService . getManagedObjectInjector ( ) ) . addDependency ( bindInfo . getParentContextServiceName ( ) , ServiceBasedNamingStore . class , binderService . getNamingStoreInjector ( ) ) . install ( ) ; ServiceBuilder svcBuilder = phaseContext . getServiceTarget ( ) . addService ( dataSourceServiceName ) ; Supplier < TransactionSynchronizationRegistry > tsrSupplier = null ; if ( transactional ) { CapabilityServiceSupport css = phaseContext . getDeploymentUnit ( ) . getAttachment ( Attachments . CAPABILITY_SERVICE_SUPPORT ) ; ServiceName tsrName = css . getCapabilityServiceName ( "org.wildfly.transactions.transaction-synchronization-registry" ) ; // noinspection unchecked
tsrSupplier = ( Supplier < TransactionSynchronizationRegistry > ) svcBuilder . requires ( tsrName ) ; } DataSourceDefinitionService dataSourceService = new DataSourceDefinitionService ( bindInfo , transactional , dataSourceConfiguration , tsrSupplier ) ; svcBuilder . setInstance ( dataSourceService ) . install ( ) ; serviceBuilder . requires ( bindInfo . getBinderServiceName ( ) ) ; serviceBuilder . addDependency ( dataSourceServiceName , ManagedReferenceFactory . class , injector ) ;


signature:
public class SFSBCallStack { /** * called from SFSBPreCreateInterceptor , before bean creation */
public static void beginSfsbCreation ( ) { } }

implementation:
SFSBCallStackThreadData data = CURRENT . get ( ) ; int no = data . creationBeanNestingLevel ; if ( no == 0 ) { data . creationTimeXPCRegistration = new HashMap < String , ExtendedEntityManager > ( ) ; // create new tracking structure ( passing in parent levels tracking structure or null if toplevel )
data . creationTimeInjectedXPCs = new SFSBInjectedXPCs ( data . creationTimeInjectedXPCs , null ) ; } else { // create new tracking structure ( passing in parent levels tracking structure or null if toplevel )
SFSBInjectedXPCs parent = data . creationTimeInjectedXPCs ; data . creationTimeInjectedXPCs = new SFSBInjectedXPCs ( parent , parent . getTopLevel ( ) ) ; } data . creationBeanNestingLevel ++ ;


signature:
public class SFSBCallStack { /** * called from SFSBPreCreateInterceptor , after bean creation */
public static void endSfsbCreation ( ) { } }

implementation:
SFSBCallStackThreadData data = CURRENT . get ( ) ; int no = data . creationBeanNestingLevel ; no -- ; data . creationBeanNestingLevel = no ; if ( no == 0 ) { // Completed creating top level bean , remove ' xpc creation tracking ' thread local
data . creationTimeXPCRegistration = null ; data . creationTimeInjectedXPCs = null ; } else { // finished creating a sub - bean , switch to parent level ' xpc creation tracking '
data . creationTimeInjectedXPCs = data . creationTimeInjectedXPCs . getParent ( ) ; }


signature:
public class SFSBCallStack { /** * return for just the current entity manager invocation
 * @ return */
public static Map < String , ExtendedEntityManager > currentSFSBCallStackInvocation ( ) { } }

implementation: ArrayList < Map < String , ExtendedEntityManager > > stack = CURRENT . get ( ) . invocationStack ; if ( stack != null && stack . size ( ) > 0 ) { return stack . get ( stack . size ( ) - 1 ) ; } return null ;


signature:
public class SFSBCallStack { /** * Pops the current SFSB invocation off the invocation call stack
 * @ return the entity manager map */
public static Map < String , ExtendedEntityManager > popCall ( ) { } }

implementation: ArrayList < Map < String , ExtendedEntityManager > > stack = currentSFSBCallStack ( ) ; Map < String , ExtendedEntityManager > result = stack . remove ( stack . size ( ) - 1 ) ; stack . trimToSize ( ) ; return result ;


signature:
public class SFSBCallStack { /** * gets the current SFSB invocation off the invocation call stack
 * @ return the entity manager map */
static Map < String , ExtendedEntityManager > getCurrentCall ( ) { } }

implementation: ArrayList < Map < String , ExtendedEntityManager > > stack = currentSFSBCallStack ( ) ; Map < String , ExtendedEntityManager > result = null ; if ( stack != null ) { result = stack . get ( stack . size ( ) - 1 ) ; } return result ;


signature:
public class WeldDependencyProcessor { /** * Add dependencies for modules required for weld deployments , if managed weld configurations are attached to the deployment */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation:
final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( Attachments . MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; addDependency ( moduleSpecification , moduleLoader , JAVAX_ENTERPRISE_API ) ; addDependency ( moduleSpecification , moduleLoader , JAVAX_INJECT_API ) ; if ( ! WeldDeploymentMarker . isPartOfWeldDeployment ( deploymentUnit ) ) { return ; // Skip if there are no beans . xml files in the deployment
} addDependency ( moduleSpecification , moduleLoader , JAVAX_PERSISTENCE_API_ID ) ; addDependency ( moduleSpecification , moduleLoader , WELD_CORE_ID ) ; addDependency ( moduleSpecification , moduleLoader , WELD_PROBE_ID , true ) ; addDependency ( moduleSpecification , moduleLoader , WELD_API_ID ) ; addDependency ( moduleSpecification , moduleLoader , WELD_SPI_ID ) ; ModuleDependency weldSubsystemDependency = new ModuleDependency ( moduleLoader , JBOSS_AS_WELD_ID , false , false , false , false ) ; weldSubsystemDependency . addImportFilter ( PathFilters . getMetaInfFilter ( ) , true ) ; weldSubsystemDependency . addImportFilter ( PathFilters . is ( "org/jboss/as/weld/injection" ) , true ) ; weldSubsystemDependency . addImportFilter ( PathFilters . acceptAll ( ) , false ) ; weldSubsystemDependency . addExportFilter ( PathFilters . getMetaInfFilter ( ) , true ) ; moduleSpecification . addSystemDependency ( weldSubsystemDependency ) ; // Due to serialization of EJBs
ModuleDependency weldEjbDependency = new ModuleDependency ( moduleLoader , JBOSS_AS_WELD_EJB_ID , true , false , false , false ) ; weldEjbDependency . addImportFilter ( PathFilters . is ( "org/jboss/as/weld/ejb" ) , true ) ; weldEjbDependency . addImportFilter ( PathFilters . acceptAll ( ) , false ) ; moduleSpecification . addSystemDependency ( weldEjbDependency ) ;


signature:
public class JSFComponentProcessor { /** * Parse the faces config files looking for managed bean classes . The parser is quite
 * simplistic as the only information we need is the managed - bean - class element */
private void processXmlManagedBeans ( final DeploymentUnit deploymentUnit , final Set < String > managedBeanClasses ) { } }

implementation:
for ( final VirtualFile facesConfig : getConfigurationFiles ( deploymentUnit ) ) { InputStream is = null ; try { is = facesConfig . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXMLResolver . create ( ) ) ; XMLStreamReader parser = inputFactory . createXMLStreamReader ( is ) ; StringBuilder className = null ; int indent = 0 ; boolean managedBean = false ; boolean managedBeanClass = false ; while ( true ) { int event = parser . next ( ) ; if ( event == XMLStreamConstants . END_DOCUMENT ) { parser . close ( ) ; break ; } if ( event == XMLStreamConstants . START_ELEMENT ) { indent ++ ; if ( indent == 2 ) { if ( parser . getLocalName ( ) . equals ( MANAGED_BEAN ) ) { managedBean = true ; } } else if ( indent == 3 && managedBean ) { if ( parser . getLocalName ( ) . equals ( MANAGED_BEAN_CLASS ) ) { managedBeanClass = true ; className = new StringBuilder ( ) ; } } } else if ( event == XMLStreamConstants . END_ELEMENT ) { indent -- ; managedBeanClass = false ; if ( indent == 1 ) { managedBean = false ; } if ( className != null ) { managedBeanClasses . add ( className . toString ( ) . trim ( ) ) ; className = null ; } } else if ( managedBeanClass && event == XMLStreamConstants . CHARACTERS ) { className . append ( parser . getText ( ) ) ; } } } catch ( Exception e ) { JSFLogger . ROOT_LOGGER . managedBeansConfigParseFailed ( facesConfig ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { // Ignore
} } }


signature:
public class JSFComponentProcessor { /** * WFLY - 6617
 * According to JSF 2.2 spec , it should be possible to inject beans using @ EJB annotation into
 * PhaseListeners . */
private void processPhaseListeners ( final DeploymentUnit deploymentUnit , final Set < String > managedBeanClasses ) { } }

implementation:
for ( final VirtualFile facesConfig : getConfigurationFiles ( deploymentUnit ) ) { InputStream is = null ; try { is = facesConfig . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXMLResolver . create ( ) ) ; XMLStreamReader parser = inputFactory . createXMLStreamReader ( is ) ; StringBuilder phaseListenerName = null ; int indent = 0 ; boolean lifecycle = false ; boolean phaseListener = false ; while ( true ) { int event = parser . next ( ) ; if ( event == XMLStreamConstants . END_DOCUMENT ) { parser . close ( ) ; break ; } if ( event == XMLStreamConstants . START_ELEMENT ) { indent ++ ; if ( indent == 2 ) { if ( parser . getLocalName ( ) . equals ( LIFECYCLE ) ) { lifecycle = true ; } } else if ( indent == 3 && lifecycle ) { if ( parser . getLocalName ( ) . equals ( PHASE_LISTENER ) ) { phaseListener = true ; phaseListenerName = new StringBuilder ( ) ; } } } else if ( event == XMLStreamConstants . END_ELEMENT ) { indent -- ; phaseListener = false ; if ( indent == 1 ) { lifecycle = false ; } if ( phaseListenerName != null ) { managedBeanClasses . add ( phaseListenerName . toString ( ) . trim ( ) ) ; phaseListenerName = null ; } } else if ( phaseListener && event == XMLStreamConstants . CHARACTERS ) { phaseListenerName . append ( parser . getText ( ) ) ; } } } catch ( Exception e ) { JSFLogger . ROOT_LOGGER . phaseListenersConfigParseFailed ( facesConfig ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { // Ignore
} } }


signature:
public class Util { /** * Return the IDL type name for the given class .
 * Here we use the mapping for parameter types and return values . */
public static String getTypeIDLName ( Class cls ) throws RMIIIOPViolationException { } }

implementation:
if ( cls . isPrimitive ( ) ) return PrimitiveAnalysis . getPrimitiveAnalysis ( cls ) . getIDLName ( ) ; if ( cls . isArray ( ) ) { // boxedRMI 1.3.6
Class componentClass = cls ; int sequence = 0 ; while ( componentClass . isArray ( ) ) { componentClass = componentClass . getComponentType ( ) ; ++ sequence ; } String idlName = getTypeIDLName ( componentClass ) ; int idx = idlName . lastIndexOf ( "::" ) ; String idlModule = idlName . substring ( 0 , idx + 2 ) ; String baseName = idlName . substring ( idx + 2 ) ; return "::org::omg::boxedRMI" + idlModule + "seq" + sequence + "_" + baseName ; } // special classes
if ( cls == java . lang . String . class ) return "::CORBA::WStringValue" ; if ( cls == java . lang . Object . class ) return "::java::lang::_Object" ; if ( cls == java . lang . Class . class ) return "::javax::rmi::CORBA::ClassDesc" ; if ( cls == java . io . Serializable . class ) return "::java::io::Serializable" ; if ( cls == java . io . Externalizable . class ) return "::java::io::Externalizable" ; if ( cls == java . rmi . Remote . class ) return "::java::rmi::Remote" ; if ( cls == org . omg . CORBA . Object . class ) return "::CORBA::Object" ; // remote interface ?
if ( cls . isInterface ( ) && java . rmi . Remote . class . isAssignableFrom ( cls ) ) { InterfaceAnalysis ia = InterfaceAnalysis . getInterfaceAnalysis ( cls ) ; return ia . getIDLModuleName ( ) + "::" + ia . getIDLName ( ) ; } // IDL interface ?
if ( cls . isInterface ( ) && org . omg . CORBA . Object . class . isAssignableFrom ( cls ) && org . omg . CORBA . portable . IDLEntity . class . isAssignableFrom ( cls ) ) { InterfaceAnalysis ia = InterfaceAnalysis . getInterfaceAnalysis ( cls ) ; return ia . getIDLModuleName ( ) + "::" + ia . getIDLName ( ) ; } // exception ?
if ( Throwable . class . isAssignableFrom ( cls ) ) { if ( Exception . class . isAssignableFrom ( cls ) && ! RuntimeException . class . isAssignableFrom ( cls ) ) { ExceptionAnalysis ea = ExceptionAnalysis . getExceptionAnalysis ( cls ) ; return ea . getIDLModuleName ( ) + "::" + ea . getIDLName ( ) ; } } // got to be value
ValueAnalysis va = ValueAnalysis . getValueAnalysis ( cls ) ; return va . getIDLModuleName ( ) + "::" + va . getIDLName ( ) ;


signature:
public class Util { /** * Check if this class is valid for RMI / IIOP mapping .
 * This method will either throw an exception or return true . */
public static boolean isValidRMIIIOP ( Class cls ) throws RMIIIOPViolationException { } }

implementation:
if ( cls . isPrimitive ( ) ) return true ; if ( cls . isArray ( ) ) return isValidRMIIIOP ( cls . getComponentType ( ) ) ; // special interfaces
if ( cls == Serializable . class || cls == Externalizable . class ) return true ; // interface ?
if ( cls . isInterface ( ) && java . rmi . Remote . class . isAssignableFrom ( cls ) ) { InterfaceAnalysis . getInterfaceAnalysis ( cls ) ; return true ; } // exception ?
if ( Throwable . class . isAssignableFrom ( cls ) ) { if ( Exception . class . isAssignableFrom ( cls ) && ! RuntimeException . class . isAssignableFrom ( cls ) ) { ExceptionAnalysis . getExceptionAnalysis ( cls ) ; } return true ; } // special values
if ( cls == Object . class || cls == String . class || cls == Class . class ) return true ; // got to be value
ValueAnalysis . getValueAnalysis ( cls ) ; return true ;


signature:
public class Util { /** * Insert a java primitive into an Any .
 * The primitive is assumed to be wrapped in one of the primitive
 * wrapper classes . */
public static void insertAnyPrimitive ( Any any , Object primitive ) { } }

implementation: Class type = primitive . getClass ( ) ; if ( type == Boolean . class ) any . insert_boolean ( ( ( Boolean ) primitive ) . booleanValue ( ) ) ; else if ( type == Character . class ) any . insert_wchar ( ( ( Character ) primitive ) . charValue ( ) ) ; else if ( type == Byte . class ) any . insert_octet ( ( ( Byte ) primitive ) . byteValue ( ) ) ; else if ( type == Short . class ) any . insert_short ( ( ( Short ) primitive ) . shortValue ( ) ) ; else if ( type == Integer . class ) any . insert_long ( ( ( Integer ) primitive ) . intValue ( ) ) ; else if ( type == Long . class ) any . insert_longlong ( ( ( Long ) primitive ) . longValue ( ) ) ; else if ( type == Float . class ) any . insert_float ( ( ( Float ) primitive ) . floatValue ( ) ) ; else if ( type == Double . class ) any . insert_double ( ( ( Double ) primitive ) . doubleValue ( ) ) ; else throw IIOPLogger . ROOT_LOGGER . notAPrimitive ( type . getName ( ) ) ;


signature:
public class Util { /** * Map Java name to IDL name , as per sections 1.3.2.3 , 1.3.2.4 and
 * 1.3.2.2.
 * This only works for a single name component , without a qualifying
 * dot . */
public static String javaToIDLName ( String name ) { } }

implementation:
if ( name == null || "" . equals ( name ) || name . indexOf ( '.' ) != - 1 ) throw IIOPLogger . ROOT_LOGGER . nameCannotBeNullEmptyOrQualified ( ) ; StringBuffer res = new StringBuffer ( name . length ( ) ) ; if ( name . charAt ( 0 ) == '_' ) res . append ( 'J' ) ; // 1.3.2.3
for ( int i = 0 ; i < name . length ( ) ; ++ i ) { char c = name . charAt ( i ) ; if ( isLegalIDLIdentifierChar ( c ) ) res . append ( c ) ; else // 1.3.2.4
res . append ( 'U' ) . append ( toHexString ( ( int ) c ) ) ; } String s = res . toString ( ) ; if ( isReservedIDLKeyword ( s ) ) return "_" + s ; else return s ;


signature:
public class Util { /** * Return the IR global ID of the given class or interface .
 * This is described in section 1.3.5.7.
 * The returned string is in the RMI hashed format , like
 * " RMI : java . util . Hashtable : C03324C0EA357270:13BB0F25214AE4B8 " . */
public static String getIRIdentifierOfClass ( Class cls ) { } }

implementation: if ( cls . isPrimitive ( ) ) throw IIOPLogger . ROOT_LOGGER . primitivesHaveNoIRIds ( ) ; String result = ( String ) classIRIdentifierCache . get ( cls ) ; if ( result != null ) return result ; String name = cls . getName ( ) ; StringBuffer b = new StringBuffer ( "RMI:" ) ; for ( int i = 0 ; i < name . length ( ) ; ++ i ) { char c = name . charAt ( i ) ; if ( c < 256 ) b . append ( c ) ; else b . append ( "\\U" ) . append ( toHexString ( ( int ) c ) ) ; } long clsHash = getClassHashCode ( cls ) ; b . append ( ':' ) . append ( toHexString ( clsHash ) ) ; ObjectStreamClass osClass = ObjectStreamClass . lookup ( cls ) ; if ( osClass != null ) { long serialVersionUID = osClass . getSerialVersionUID ( ) ; if ( clsHash != serialVersionUID ) b . append ( ':' ) . append ( toHexString ( serialVersionUID ) ) ; } result = b . toString ( ) ; classIRIdentifierCache . put ( cls , result ) ; return result ;


signature:
public class Util { /** * Determine if the argument is a reserved IDL keyword . */
private static boolean isReservedIDLKeyword ( String s ) { } }

implementation:
// TODO : faster lookup
for ( int i = 0 ; i < reservedIDLKeywords . length ; ++ i ) if ( reservedIDLKeywords [ i ] . equals ( s ) ) return true ; return false ;


signature:
public class Util { /** * Determine if a < code > char < / code > is a legal IDL identifier character . */
private static boolean isLegalIDLIdentifierChar ( char c ) { } }

implementation:
if ( c >= 0x61 && c <= 0x7a ) return true ; // lower case letter
if ( c >= 0x30 && c <= 0x39 ) return true ; // digit
if ( c >= 0x41 && c <= 0x5a ) return true ; // upper case letter
if ( c == '_' ) return true ; // underscore
return false ;


signature:
public class Util { /** * Return the class hash code , as specified in " The Common Object
 * Request Broker : Architecture and Specification " ( 01-02-33 ) ,
 * section 10.6.2. */
static long getClassHashCode ( Class cls ) { } }

implementation:
// The simple cases
if ( cls . isInterface ( ) ) return 0 ; if ( ! Serializable . class . isAssignableFrom ( cls ) ) return 0 ; if ( Externalizable . class . isAssignableFrom ( cls ) ) return 1 ; // Try cache
Long l = ( Long ) classHashCodeCache . get ( cls ) ; if ( l != null ) return l . longValue ( ) ; // Has to calculate the hash .
ByteArrayOutputStream baos = new ByteArrayOutputStream ( 256 ) ; DataOutputStream dos = new DataOutputStream ( baos ) ; // Step 1
Class superClass = cls . getSuperclass ( ) ; if ( superClass != null && superClass != Object . class ) { try { dos . writeLong ( getClassHashCode ( superClass ) ) ; } catch ( IOException ex ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( ex ) ; } } // Step 2
boolean hasWriteObject = false ; try { Method m ; int mods ; m = cls . getDeclaredMethod ( "writeObject" , new Class [ ] { ObjectOutputStream . class } ) ; mods = m . getModifiers ( ) ; if ( ! Modifier . isPrivate ( mods ) && ! Modifier . isStatic ( mods ) ) hasWriteObject = true ; } catch ( NoSuchMethodException ex ) { // ignore
} try { dos . writeInt ( hasWriteObject ? 2 : 1 ) ; } catch ( IOException ex ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( ex ) ; } // Step 3
Field [ ] fields = cls . getDeclaredFields ( ) ; SortedSet set = new TreeSet ( new FieldComparator ( ) ) ; for ( int i = 0 ; i < fields . length ; ++ i ) { int mods = fields [ i ] . getModifiers ( ) ; if ( ! Modifier . isStatic ( mods ) && ! Modifier . isTransient ( mods ) ) set . add ( fields [ i ] ) ; } Iterator iter = set . iterator ( ) ; try { while ( iter . hasNext ( ) ) { Field f = ( Field ) iter . next ( ) ; dos . writeUTF ( f . getName ( ) ) ; dos . writeUTF ( getSignature ( f . getType ( ) ) ) ; } } catch ( IOException ex ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( ex ) ; } // Convert to byte [ ]
try { dos . flush ( ) ; } catch ( IOException ex ) { throw IIOPLogger . ROOT_LOGGER . unexpectedException ( ex ) ; } byte [ ] bytes = baos . toByteArray ( ) ; // Calculate SHA digest
MessageDigest digest ; try { digest = MessageDigest . getInstance ( "SHA" ) ; } catch ( NoSuchAlgorithmException ex ) { throw IIOPLogger . ROOT_LOGGER . unavailableSHADigest ( ex ) ; } digest . update ( bytes ) ; byte [ ] sha = digest . digest ( ) ; // Calculate hash as per section 10.6.2
long hash = 0 ; for ( int i = 0 ; i < Math . min ( 8 , sha . length ) ; i ++ ) { hash += ( long ) ( sha [ i ] & 255 ) << ( i * 8 ) ; } // Save in cache
classHashCodeCache . put ( cls , new Long ( hash ) ) ; return hash ;


signature:
public class Util { /** * Calculate the signature of a class , according to the Java VM
 * specification , section 4.3.2. */
private static String getSignature ( Class cls ) { } }

implementation: if ( cls . isArray ( ) ) return "[" + cls . getComponentType ( ) ; if ( cls . isPrimitive ( ) ) { if ( cls == Byte . TYPE ) return "B" ; if ( cls == Character . TYPE ) return "C" ; if ( cls == Double . TYPE ) return "D" ; if ( cls == Float . TYPE ) return "F" ; if ( cls == Integer . TYPE ) return "I" ; if ( cls == Long . TYPE ) return "J" ; if ( cls == Short . TYPE ) return "S" ; if ( cls == Boolean . TYPE ) return "Z" ; throw IIOPLogger . ROOT_LOGGER . unknownPrimitiveType ( cls . getName ( ) ) ; } return "L" + cls . getName ( ) . replace ( '.' , '/' ) + ";" ;


signature:
public class Util { /** * Calculate the signature of a method , according to the Java VM
 * specification , section 4.3.3. */
private static String getSignature ( Method method ) { } }

implementation: StringBuffer b = new StringBuffer ( "(" ) ; Class [ ] parameterTypes = method . getParameterTypes ( ) ; for ( int i = 0 ; i < parameterTypes . length ; ++ i ) b . append ( getSignature ( parameterTypes [ i ] ) ) ; b . append ( ')' ) . append ( getSignature ( method . getReturnType ( ) ) ) ; return b . toString ( ) ;


signature:
public class Util { /** * Handle mappings for primitive types , as per section 1.3.3. */
static String primitiveTypeIDLName ( Class type ) { } }

implementation: if ( type == Void . TYPE ) return "void" ; if ( type == Boolean . TYPE ) return "boolean" ; if ( type == Character . TYPE ) return "wchar" ; if ( type == Byte . TYPE ) return "octet" ; if ( type == Short . TYPE ) return "short" ; if ( type == Integer . TYPE ) return "long" ; if ( type == Long . TYPE ) return "long long" ; if ( type == Float . TYPE ) return "float" ; if ( type == Double . TYPE ) return "double" ; throw IIOPLogger . ROOT_LOGGER . notAPrimitive ( type . getName ( ) ) ;


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

implementation: final VirtualFile deploymentRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( Attachments . DEPLOYMENT_ROOT ) . getRoot ( ) ; process ( deploymentRoot ) ;


signature:
public class BatchPermission { /** * Get the permission with the given name .
 * @ param name the name ( must not be { @ code null } )
 * @ return the permission ( not { @ code null } )
 * @ throws IllegalArgumentException if the name is not valid */
public static BatchPermission forName ( final String name ) { } }

implementation: Assert . checkNotNullParam ( "name" , name ) ; return "*" . equals ( name ) ? allPermission : mapping . getItemByString ( name ) ;


signature:
public class TransactionJndiBindingProcessor { /** * Binds the java : comp / UserTransaction service and the java : comp / TransactionSynchronizationRegistry
 * @ param deploymentUnit The deployment unit
 * @ param serviceTarget The service target
 * @ param contextServiceName The service name of the context to bind to */
private void bindServices ( DeploymentUnit deploymentUnit , ServiceTarget serviceTarget , ServiceName contextServiceName ) { } }

implementation: final ServiceName userTransactionServiceName = contextServiceName . append ( "UserTransaction" ) ; final UserTransactionBindingService userTransactionBindingService = new UserTransactionBindingService ( "UserTransaction" ) ; serviceTarget . addService ( userTransactionServiceName , userTransactionBindingService ) . addDependency ( UserTransactionAccessControlService . SERVICE_NAME , UserTransactionAccessControlService . class , userTransactionBindingService . getUserTransactionAccessControlServiceInjector ( ) ) . addDependency ( UserTransactionService . INTERNAL_SERVICE_NAME , UserTransaction . class , new ManagedReferenceInjector < UserTransaction > ( userTransactionBindingService . getManagedObjectInjector ( ) ) ) . addDependency ( contextServiceName , ServiceBasedNamingStore . class , userTransactionBindingService . getNamingStoreInjector ( ) ) . install ( ) ; final Map < ServiceName , Set < ServiceName > > jndiComponentDependencies = deploymentUnit . getAttachment ( org . jboss . as . server . deployment . Attachments . COMPONENT_JNDI_DEPENDENCIES ) ; Set < ServiceName > jndiDependencies = jndiComponentDependencies . get ( contextServiceName ) ; if ( jndiDependencies == null ) { jndiComponentDependencies . put ( contextServiceName , jndiDependencies = new HashSet < > ( ) ) ; } jndiDependencies . add ( userTransactionServiceName ) ; final ServiceName transactionSynchronizationRegistryName = contextServiceName . append ( "TransactionSynchronizationRegistry" ) ; BinderService transactionSyncBinderService = new BinderService ( "TransactionSynchronizationRegistry" ) ; serviceTarget . addService ( transactionSynchronizationRegistryName , transactionSyncBinderService ) . addDependency ( TransactionSynchronizationRegistryService . INTERNAL_SERVICE_NAME , TransactionSynchronizationRegistry . class , new ManagedReferenceInjector < TransactionSynchronizationRegistry > ( transactionSyncBinderService . getManagedObjectInjector ( ) ) ) . addDependency ( contextServiceName , ServiceBasedNamingStore . class , transactionSyncBinderService . getNamingStoreInjector ( ) ) . install ( ) ; jndiDependencies . add ( transactionSynchronizationRegistryName ) ;


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

implementation:
final ModelNode ejb3SubsystemAddOperation = new ModelNode ( ) ; ejb3SubsystemAddOperation . get ( OP ) . set ( ADD ) ; ejb3SubsystemAddOperation . get ( OP_ADDR ) . add ( SUBSYSTEM , EJB3Extension . SUBSYSTEM_NAME ) ; operations . add ( ejb3SubsystemAddOperation ) ; // elements
final EnumSet < EJB3SubsystemXMLElement > encountered = EnumSet . noneOf ( EJB3SubsystemXMLElement . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != XMLStreamConstants . END_ELEMENT ) { switch ( EJB3SubsystemNamespace . forUri ( reader . getNamespaceURI ( ) ) ) { case EJB3_1_1 : { final EJB3SubsystemXMLElement element = EJB3SubsystemXMLElement . forName ( reader . getLocalName ( ) ) ; if ( ! encountered . add ( element ) ) { throw unexpectedElement ( reader ) ; } switch ( element ) { case MDB : { // read < mdb >
this . parseMDB ( reader , operations , ejb3SubsystemAddOperation ) ; break ; } case POOLS : { // read < pools >
this . parsePools ( reader , operations ) ; break ; } case SESSION_BEAN : { // read < session - bean >
this . parseSessionBean ( reader , operations , ejb3SubsystemAddOperation ) ; break ; } case TIMER_SERVICE : { parseTimerService ( reader , operations ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class InjectionTargets { /** * Creates a new InjectionTarget for a given class . If the interceptionSupport flag is set to true the resulting instance will support
 * interception ( support provided by Weld ) . If an InjectionTarget is created for a component where interception support is implemented
 * through component ' s view ( EJBs , managed beans ) the flag must be set to false .
 * @ param componentClass
 * @ param bean
 * @ param beanManager
 * @ param interceptionSupport
 * @ return */
public static < T > WeldInjectionTarget < T > createInjectionTarget ( Class < ? > componentClass , Bean < T > bean , BeanManagerImpl beanManager , boolean interceptionSupport ) { } }

implementation:
final ClassTransformer transformer = beanManager . getServices ( ) . get ( ClassTransformer . class ) ; @ SuppressWarnings ( "unchecked" ) final Class < T > clazz = ( Class < T > ) componentClass ; EnhancedAnnotatedType < T > type = transformer . getEnhancedAnnotatedType ( clazz , beanManager . getId ( ) ) ; if ( ! type . getJavaClass ( ) . equals ( componentClass ) ) { /* * Jasper loads a class with multiple classloaders which is not supported by Weld .
 * If this happens , use a combination of a bean archive identifier and class ' classloader hashCode as the BDA ID .
 * This breaks AnnotatedType serialization but that does not matter as these are non - contextual components . */
final ClassLoader classLoader = WildFlySecurityManager . isChecking ( ) ? doPrivileged ( new GetClassLoaderAction ( componentClass ) ) : componentClass . getClassLoader ( ) ; final String bdaId = beanManager . getId ( ) + classLoader . hashCode ( ) ; type = transformer . getEnhancedAnnotatedType ( clazz , bdaId ) ; } if ( Beans . getBeanConstructor ( type ) == null ) { /* * For example , AsyncListeners may be CDI - incompatible as long as the application never calls javax . servletAsyncContext # createListener ( Class )
 * and only instantiates the listener itself . */
return beanManager . getInjectionTargetFactory ( type ) . createNonProducibleInjectionTarget ( ) ; } WeldInjectionTargetBuilder < T > builder = beanManager . createInjectionTargetBuilder ( type ) ; builder . setBean ( bean ) ; builder . setResourceInjectionEnabled ( false ) ; // because these are all EE components where resource injection is not handled by Weld
if ( interceptionSupport ) { return builder . build ( ) ; } else { // suppress interception / decoration because this is a component for which WF provides interception support
return builder . setInterceptionEnabled ( false ) . setTargetClassLifecycleCallbacksEnabled ( false ) . setDecorationEnabled ( false ) . build ( ) ; }


signature:
public class FixedInjectionSource { /** * { @ inheritDoc } */
public void getResourceValue ( final ResolutionContext resolutionContext , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) { } }

implementation: injector . inject ( managedReferenceFactory ) ;


signature:
public class TransactionScopedEntityManager { /** * get or create a Transactional entity manager .
 * Only call while a transaction is active in the current thread .
 * @ param emf
 * @ param scopedPuName
 * @ param properties
 * @ param synchronizationType
 * @ return */
private EntityManager getOrCreateTransactionScopedEntityManager ( final EntityManagerFactory emf , final String scopedPuName , final Map properties , final SynchronizationType synchronizationType ) { } }

implementation: EntityManager entityManager = TransactionUtil . getTransactionScopedEntityManager ( puScopedName , transactionSynchronizationRegistry ) ; if ( entityManager == null ) { entityManager = createEntityManager ( emf , properties , synchronizationType ) ; if ( ROOT_LOGGER . isDebugEnabled ( ) ) { ROOT_LOGGER . debugf ( "%s: created entity manager session %s" , TransactionUtil . getEntityManagerDetails ( entityManager , scopedPuName ) , TransactionUtil . getTransaction ( transactionManager ) . toString ( ) ) ; } TransactionUtil . registerSynchronization ( entityManager , scopedPuName , transactionSynchronizationRegistry , transactionManager ) ; TransactionUtil . putEntityManagerInTransactionRegistry ( scopedPuName , entityManager , transactionSynchronizationRegistry ) ; } else { testForMixedSynchronizationTypes ( emf , entityManager , puScopedName , synchronizationType , properties ) ; if ( ROOT_LOGGER . isDebugEnabled ( ) ) { ROOT_LOGGER . debugf ( "%s: reuse entity manager session already in tx %s" , TransactionUtil . getEntityManagerDetails ( entityManager , scopedPuName ) , TransactionUtil . getTransaction ( transactionManager ) . toString ( ) ) ; } } return entityManager ;


signature:
public class TransactionScopedEntityManager { /** * return true if non - tx invocations should defer detaching of entities until entity manager is closed .
 * Note that this is an extension for compatibility with JBoss application server 5.0/6.0 ( see AS7-2781) */
@ Override protected boolean deferEntityDetachUntilClose ( ) { } }

implementation: if ( deferDetach == null ) deferDetach = ( true == Configuration . deferEntityDetachUntilClose ( emf . getProperties ( ) ) ? Boolean . TRUE : Boolean . FALSE ) ; return deferDetach . booleanValue ( ) ;


signature:
public class ConcurrentReferenceHashMap { /** * Returns < tt > true < / tt > if this map maps one or more keys to the
 * specified value . Note : This method requires a full internal
 * traversal of the hash table , and so is much slower than
 * method < tt > containsKey < / tt > .
 * @ param value value whose presence in this map is to be tested
 * @ return < tt > true < / tt > if this map maps one or more keys to the
 * specified value
 * @ throws NullPointerException if the specified value is null */
public boolean containsValue ( Object value ) { } }

implementation:
if ( value == null ) throw new NullPointerException ( ) ; // See explanation of modCount use above
final Segment < K , V > [ ] segments = this . segments ; int [ ] mc = new int [ segments . length ] ; // Try a few times without locking
for ( int k = 0 ; k < RETRIES_BEFORE_LOCK ; ++ k ) { int mcsum = 0 ; for ( int i = 0 ; i < segments . length ; ++ i ) { mcsum += mc [ i ] = segments [ i ] . modCount ; if ( segments [ i ] . containsValue ( value ) ) return true ; } boolean cleanSweep = true ; if ( mcsum != 0 ) { for ( int i = 0 ; i < segments . length ; ++ i ) { if ( mc [ i ] != segments [ i ] . modCount ) { cleanSweep = false ; break ; } } } if ( cleanSweep ) return false ; } // Resort to locking all segments
for ( int i = 0 ; i < segments . length ; ++ i ) segments [ i ] . lock ( ) ; boolean found = false ; try { for ( int i = 0 ; i < segments . length ; ++ i ) { if ( segments [ i ] . containsValue ( value ) ) { found = true ; break ; } } } finally { for ( int i = 0 ; i < segments . length ; ++ i ) segments [ i ] . unlock ( ) ; } return found ;


signature:
public class ConcurrentReferenceHashMap { /** * Maps the specified key to the specified value in this table .
 * Neither the key nor the value can be null .
 * < p > The value can be retrieved by calling the < tt > get < / tt > method
 * with a key that is equal to the original key .
 * @ param key key with which the specified value is to be associated
 * @ param value value to be associated with the specified key
 * @ return the previous value associated with < tt > key < / tt > , or
 * < tt > null < / tt > if there was no mapping for < tt > key < / tt >
 * @ throws NullPointerException if the specified key or value is null */
public V put ( K key , V value ) { } }

implementation: if ( value == null ) throw new NullPointerException ( ) ; int hash = hashOf ( key ) ; return segmentFor ( hash ) . put ( key , hash , value , false ) ;