Input: Removes activation config properties which aren t recognized by the resource adapter <code > activation< / code > from the passed <code > activationConfigProps< / code > and returns only those Properties which are valid . [CODESPLIT] private Properties filterUnknownActivationConfigProperties ( final String resourceAdapterName , final Activation activation , final Properties activationConfigProps ) { if ( activationConfigProps == null ) { return null ; } final Map < String , Class < ? > > raActivationConfigProps = activation . getConfigProperties ( ) ; final Set < String > raRequiredConfigProps = activation . getRequiredConfigProperties ( ) ; final Enumeration < ? > propNames = activationConfigProps . propertyNames ( ) ; final Properties validActivationConfigProps = new Properties ( ) ; // initialize to all the activation config properties that have been set on the MDB validActivationConfigProps . putAll ( activationConfigProps ) ; while ( propNames . hasMoreElements ( ) ) { final Object propName = propNames . nextElement ( ) ; if ( raActivationConfigProps . containsKey ( propName ) == false && raRequiredConfigProps . contains ( propName ) == false ) { // not a valid activation config property, so log a WARN and filter it out from the valid activation config properties validActivationConfigProps . remove ( propName ) ; EjbLogger . ROOT_LOGGER . activationConfigPropertyIgnored ( propName , resourceAdapterName ) ; } } return validActivationConfigProps ; }


Input: Returns the { @link org . jboss . jca . core . spi . rar . Endpoint } corresponding to the passed <code > resourceAdapterName< / code > [CODESPLIT] private Endpoint getEndpoint ( final String resourceAdapterName ) { // first get the ra "identifier" (with which it is registered in the resource adapter repository) for the // ra name final String raIdentifier = ConnectorServices . getRegisteredResourceAdapterIdentifier ( resourceAdapterName ) ; if ( raIdentifier == null ) { throw EjbLogger . ROOT_LOGGER . unknownResourceAdapter ( resourceAdapterName ) ; } final ResourceAdapterRepository resourceAdapterRepository = resourceAdapterRepositoryInjectedValue . getValue ( ) ; if ( resourceAdapterRepository == null ) { throw EjbLogger . ROOT_LOGGER . resourceAdapterRepositoryUnAvailable ( ) ; } try { return resourceAdapterRepository . getEndpoint ( raIdentifier ) ; } catch ( NotFoundException nfe ) { throw EjbLogger . ROOT_LOGGER . noSuchEndpointException ( resourceAdapterName , nfe ) ; } }


Input: Create a JBoss Security Context with the given security domain name [CODESPLIT] static SecurityContext createSecurityContext ( final String domain ) { if ( WildFlySecurityManager . isChecking ( ) ) { return WildFlySecurityManager . doUnchecked ( new PrivilegedAction < SecurityContext > ( ) { @ Override public SecurityContext run ( ) { try { return SecurityContextFactory . createSecurityContext ( domain ) ; } catch ( Exception e ) { throw UndertowLogger . ROOT_LOGGER . failToCreateSecurityContext ( e ) ; } } } ) ; } else { try { return SecurityContextFactory . createSecurityContext ( domain ) ; } catch ( Exception e ) { throw UndertowLogger . ROOT_LOGGER . failToCreateSecurityContext ( e ) ; } } }


Input: Set the { @code SecurityContext } on the { @code SecurityContextAssociation } [CODESPLIT] static void setSecurityContextOnAssociation ( final SecurityContext sc ) { if ( WildFlySecurityManager . isChecking ( ) ) { WildFlySecurityManager . doUnchecked ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { SecurityContextAssociation . setSecurityContext ( sc ) ; return null ; } } ) ; } else { SecurityContextAssociation . setSecurityContext ( sc ) ; } }


Input: Get the current { @code SecurityContext } [CODESPLIT] static SecurityContext getSecurityContext ( ) { if ( WildFlySecurityManager . isChecking ( ) ) { return WildFlySecurityManager . doUnchecked ( new PrivilegedAction < SecurityContext > ( ) { public SecurityContext run ( ) { return SecurityContextAssociation . getSecurityContext ( ) ; } } ) ; } else { return SecurityContextAssociation . getSecurityContext ( ) ; } }


Input: Clears current { [CODESPLIT] static void clearSecurityContext ( ) { if ( WildFlySecurityManager . isChecking ( ) ) { WildFlySecurityManager . doUnchecked ( new PrivilegedAction < Void > ( ) { public Void run ( ) { SecurityContextAssociation . clearSecurityContext ( ) ; return null ; } } ) ; } else { SecurityContextAssociation . clearSecurityContext ( ) ; } }


Input: Sets the run as identity [CODESPLIT] static RunAs setRunAsIdentity ( final RunAs principal , final SecurityContext sc ) { if ( WildFlySecurityManager . isChecking ( ) ) { return WildFlySecurityManager . doUnchecked ( new PrivilegedAction < RunAs > ( ) { @ Override public RunAs run ( ) { if ( sc == null ) { throw UndertowLogger . ROOT_LOGGER . noSecurityContext ( ) ; } RunAs old = sc . getOutgoingRunAs ( ) ; sc . setOutgoingRunAs ( principal ) ; return old ; } } ) ; } else { if ( sc == null ) { throw UndertowLogger . ROOT_LOGGER . noSecurityContext ( ) ; } RunAs old = sc . getOutgoingRunAs ( ) ; sc . setOutgoingRunAs ( principal ) ; return old ; } }


Input: Removes the run as identity [CODESPLIT] static RunAs popRunAsIdentity ( final SecurityContext sc ) { if ( WildFlySecurityManager . isChecking ( ) ) { return AccessController . doPrivileged ( new PrivilegedAction < RunAs > ( ) { @ Override public RunAs run ( ) { if ( sc == null ) { throw UndertowLogger . ROOT_LOGGER . noSecurityContext ( ) ; } RunAs principal = sc . getOutgoingRunAs ( ) ; sc . setOutgoingRunAs ( null ) ; return principal ; } } ) ; } else { if ( sc == null ) { throw UndertowLogger . ROOT_LOGGER . noSecurityContext ( ) ; } RunAs principal = sc . getOutgoingRunAs ( ) ; sc . setOutgoingRunAs ( null ) ; return principal ; } }


Input: todo move to UndertowDeploymentService and use all registered servlets from Deployment instead of just one found by metadata [CODESPLIT] void processManagement ( final DeploymentUnit unit , JBossWebMetaData metaData ) { final DeploymentResourceSupport deploymentResourceSupport = unit . getAttachment ( Attachments . DEPLOYMENT_RESOURCE_SUPPORT ) ; for ( final JBossServletMetaData servlet : metaData . getServlets ( ) ) { try { final String name = servlet . getName ( ) ; final ModelNode node = deploymentResourceSupport . getDeploymentSubModel ( UndertowExtension . SUBSYSTEM_NAME , PathElement . pathElement ( "servlet" , name ) ) ; node . get ( "servlet-class" ) . set ( servlet . getServletClass ( ) ) ; node . get ( "servlet-name" ) . set ( servlet . getServletName ( ) ) ; } catch ( Exception e ) { // Should a failure in creating the mgmt view also make to the deployment to fail? continue ; } } }


Input: Try to obtain the security domain configured in jboss - app . xml at the ear level if available [CODESPLIT] private String getJBossAppSecurityDomain ( final DeploymentUnit deploymentUnit ) { String securityDomain = null ; DeploymentUnit parent = deploymentUnit . getParent ( ) ; if ( parent != null ) { final EarMetaData jbossAppMetaData = parent . getAttachment ( org . jboss . as . ee . structure . Attachments . EAR_METADATA ) ; if ( jbossAppMetaData instanceof JBossAppMetaData ) { securityDomain = ( ( JBossAppMetaData ) jbossAppMetaData ) . getSecurityDomain ( ) ; } } return securityDomain != null ? securityDomain . trim ( ) : null ; }


Input: ContainedImpl implementation ---------------------------------- [CODESPLIT] public Description describe ( ) { String defined_in_id = "IR" ; if ( defined_in instanceof ContainedOperations ) defined_in_id = ( ( ContainedOperations ) defined_in ) . id ( ) ; ConstantDescription d = new ConstantDescription ( name , id , defined_in_id , version , typeCode , value ) ; Any any = getORB ( ) . create_any ( ) ; ConstantDescriptionHelper . insert ( any , d ) ; return new Description ( DefinitionKind . dk_Constant , any ) ; }


Input: Install a binder service to bind the { @code obj } using the binding { @code name } . [CODESPLIT] public static void installBinderService ( final ServiceTarget serviceTarget , final String name , final Object obj ) { final BindInfo bindInfo = ContextNames . bindInfoFor ( name ) ; final BinderService binderService = new BinderService ( bindInfo . getBindName ( ) ) ; binderService . getManagedObjectInjector ( ) . inject ( new ValueManagedReferenceFactory ( Values . immediateValue ( obj ) ) ) ; serviceTarget . addService ( bindInfo . getBinderServiceName ( ) , binderService ) . addDependency ( bindInfo . getParentContextServiceName ( ) , ServiceBasedNamingStore . class , binderService . getNamingStoreInjector ( ) ) . install ( ) ; }


Input: Install a binder service to bind the value of the { @code service } using the binding { @code name } . [CODESPLIT] public static void installBinderService ( final ServiceTarget serviceTarget , final String name , final Service < ? > service , final ServiceName dependency ) { final BindInfo bindInfo = ContextNames . bindInfoFor ( name ) ; final BinderService binderService = new BinderService ( bindInfo . getBindName ( ) ) ; binderService . getManagedObjectInjector ( ) . inject ( new ValueManagedReferenceFactory ( service ) ) ; final ServiceBuilder serviceBuilder = serviceTarget . addService ( bindInfo . getBinderServiceName ( ) , binderService ) . addDependency ( bindInfo . getParentContextServiceName ( ) , ServiceBasedNamingStore . class , binderService . getNamingStoreInjector ( ) ) // we set it in passive mode so that missing dependencies (which is possible/valid when it's a backup HornetQ server and the services // haven't been activated on it due to the presence of a different live server) don't cause jms-topic/jms-queue add operations // to fail . setInitialMode ( ServiceController . Mode . PASSIVE ) ; if ( dependency != null ) { serviceBuilder . requires ( dependency ) ; } serviceBuilder . install ( ) ; }


Input: Overrides the default impl to use a special definition of the add op that includes additional parameter { [CODESPLIT] @ Override protected void registerAddOperation ( ManagementResourceRegistration registration , AbstractAddStepHandler handler , OperationEntry . Flag ... flags ) { OperationDefinition od = new SimpleOperationDefinitionBuilder ( ADD , getResourceDescriptionResolver ( ) ) . setParameters ( ATTRIBUTES ) . addParameter ( DEFAULT_CLUSTERED_SFSB_CACHE ) . withFlags ( flags ) . build ( ) ; registration . registerOperationHandler ( od , handler ) ; }


Input: Inject a value into an object property [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public void inject ( Object object , String propertyName , Object propertyValue ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { inject ( object , propertyName , propertyValue , null , false ) ; }


Input: Compare the type of a class with the actual value [CODESPLIT] private boolean argumentMatches ( String classType , String propertyType ) { return ( classType . equals ( propertyType ) ) || ( classType . equals ( "java.lang.Byte" ) && propertyType . equals ( "byte" ) ) || ( classType . equals ( "java.lang.Short" ) && propertyType . equals ( "short" ) ) || ( classType . equals ( "java.lang.Integer" ) && propertyType . equals ( "int" ) ) || ( classType . equals ( "java.lang.Long" ) && propertyType . equals ( "long" ) ) || ( classType . equals ( "java.lang.Float" ) && propertyType . equals ( "float" ) ) || ( classType . equals ( "java.lang.Double" ) && propertyType . equals ( "double" ) ) || ( classType . equals ( "java.lang.Boolean" ) && propertyType . equals ( "boolean" ) ) || ( classType . equals ( "java.lang.Character" ) && propertyType . equals ( "char" ) ) ; }


Input: Find a method [CODESPLIT] protected Method findMethod ( Class < ? > clz , String methodName , String propertyType ) { while ( ! clz . equals ( Object . class ) ) { List < Method > hits = null ; Method [ ] methods = SecurityActions . getDeclaredMethods ( clz ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { final Method method = methods [ i ] ; if ( methodName . equals ( method . getName ( ) ) && method . getParameterTypes ( ) . length == 1 ) { if ( propertyType == null || argumentMatches ( propertyType , method . getParameterTypes ( ) [ 0 ] . getName ( ) ) ) { if ( hits == null ) hits = new ArrayList < Method > ( 1 ) ; SecurityActions . setAccessible ( method ) ; hits . add ( method ) ; } } } if ( hits != null ) { if ( hits . size ( ) == 1 ) { return hits . get ( 0 ) ; } else { Collections . sort ( hits , new MethodSorter ( ) ) ; if ( propertyType != null ) { for ( Method m : hits ) { if ( propertyType . equals ( m . getParameterTypes ( ) [ 0 ] . getName ( ) ) ) return m ; } } return hits . get ( 0 ) ; } } clz = clz . getSuperclass ( ) ; } return null ; }


Input: Find a field [CODESPLIT] protected Field findField ( Class < ? > clz , String fieldName , String fieldType ) { while ( ! clz . equals ( Object . class ) ) { List < Field > hits = null ; Field [ ] fields = SecurityActions . getDeclaredFields ( clz ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { final Field field = fields [ i ] ; if ( fieldName . equals ( field . getName ( ) ) ) { if ( fieldType == null || argumentMatches ( fieldType , field . getType ( ) . getName ( ) ) ) { if ( hits == null ) hits = new ArrayList < Field > ( 1 ) ; SecurityActions . setAccessible ( field ) ; hits . add ( field ) ; } } } if ( hits != null ) { if ( hits . size ( ) == 1 ) { return hits . get ( 0 ) ; } else { Collections . sort ( hits , new FieldSorter ( ) ) ; if ( fieldType != null ) { for ( Field f : hits ) { if ( fieldType . equals ( f . getType ( ) . getName ( ) ) ) return f ; } } return hits . get ( 0 ) ; } } clz = clz . getSuperclass ( ) ; } return null ; }


Input: { [CODESPLIT] public Object processInvocation ( final InterceptorContext context ) throws Exception { final ManagedReference reference = ( ManagedReference ) context . getPrivateData ( ComponentInstance . class ) . getInstanceData ( contextKey ) ; final Object instance = reference . getInstance ( ) ; try { final Method method = this . method ; if ( withContext ) { final Method oldMethod = context . getMethod ( ) ; try { if ( this . lifecycleMethod ) { // because InvocationContext#getMethod() is expected to return null for lifecycle methods context . setMethod ( null ) ; return method . invoke ( instance , context . getInvocationContext ( ) ) ; } else if ( this . changeMethod ) { context . setMethod ( method ) ; return method . invoke ( instance , context . getInvocationContext ( ) ) ; } else { return method . invoke ( instance , context . getInvocationContext ( ) ) ; } } finally { // reset any changed method on the interceptor context context . setMethod ( oldMethod ) ; } } else { method . invoke ( instance ) ; return context . proceed ( ) ; } } catch ( IllegalAccessException e ) { final IllegalAccessError n = new IllegalAccessError ( e . getMessage ( ) ) ; n . setStackTrace ( e . getStackTrace ( ) ) ; throw n ; } catch ( InvocationTargetException e ) { throw Interceptors . rethrow ( e . getCause ( ) ) ; } }


Input: Process a deployment for standard ra deployment files . Will parse the xml file and attach a configuration discovered during processing . [CODESPLIT] @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; boolean resolveProperties = Util . shouldResolveJBoss ( deploymentUnit ) ; final PropertyResolver propertyResolver = deploymentUnit . getAttachment ( org . jboss . as . ee . metadata . property . Attachments . FINAL_PROPERTY_RESOLVER ) ; final PropertyReplacer propertyReplacer = deploymentUnit . getAttachment ( org . jboss . as . ee . metadata . property . Attachments . FINAL_PROPERTY_REPLACER ) ; final Set < VirtualFile > files = dataSources ( deploymentUnit ) ; boolean loggedDeprication = false ; for ( VirtualFile f : files ) { InputStream xmlStream = null ; try { xmlStream = new FileInputStream ( f . getPhysicalFile ( ) ) ; DsXmlParser parser = new DsXmlParser ( propertyResolver , propertyReplacer ) ; parser . setSystemPropertiesResolved ( resolveProperties ) ; DataSources dataSources = parser . parse ( xmlStream ) ; if ( dataSources != null ) { if ( ! loggedDeprication ) { loggedDeprication = true ; ConnectorLogger . ROOT_LOGGER . deprecated ( ) ; } for ( DataSource ds : dataSources . getDataSource ( ) ) { if ( ds . getDriver ( ) == null ) { throw ConnectorLogger . ROOT_LOGGER . FailedDeployDriverNotSpecified ( ds . getJndiName ( ) ) ; } } deploymentUnit . addToAttachmentList ( DATA_SOURCES_ATTACHMENT_KEY , dataSources ) ; } } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( e . getMessage ( ) , e ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } }


Input: escape any occurrence of / . and \ [CODESPLIT] private static String escape ( String s ) { StringBuffer sb = new StringBuffer ( s ) ; for ( int i = 0 ; i < sb . length ( ) ; i ++ ) { if ( sb . charAt ( i ) == ' ' || sb . charAt ( i ) == ' ' || sb . charAt ( i ) == ' ' ) { sb . insert ( i , ' ' ) ; i ++ ; } } return sb . toString ( ) ; }


Input: Build options for non - interactive VaultTool usage scenario . [CODESPLIT] private void initOptions ( ) { options = new Options ( ) ; options . addOption ( "k" , KEYSTORE_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineKeyStoreURL ( ) ) ; options . addOption ( "p" , KEYSTORE_PASSWORD_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineKeyStorePassword ( ) ) ; options . addOption ( "e" , ENC_DIR_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineEncryptionDirectory ( ) ) ; options . addOption ( "s" , SALT_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineSalt ( ) ) ; options . addOption ( "i" , ITERATION_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineIterationCount ( ) ) ; options . addOption ( "v" , ALIAS_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineVaultKeyStoreAlias ( ) ) ; options . addOption ( "b" , VAULT_BLOCK_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineVaultBlock ( ) ) ; options . addOption ( "a" , ATTRIBUTE_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineAttributeName ( ) ) ; options . addOption ( "t" , CREATE_KEYSTORE_PARAM , false , SecurityLogger . ROOT_LOGGER . cmdLineAutomaticallyCreateKeystore ( ) ) ; OptionGroup og = new OptionGroup ( ) ; Option x = new Option ( "x" , SEC_ATTR_VALUE_PARAM , true , SecurityLogger . ROOT_LOGGER . cmdLineSecuredAttribute ( ) ) ; Option c = new Option ( "c" , CHECK_SEC_ATTR_EXISTS_PARAM , false , SecurityLogger . ROOT_LOGGER . cmdLineCheckAttribute ( ) ) ; Option r = new Option ( "r" , REMOVE_SEC_ATTR_PARAM , false , SecurityLogger . ROOT_LOGGER . cmdLineRemoveSecuredAttribute ( ) ) ; Option h = new Option ( "h" , HELP_PARAM , false , SecurityLogger . ROOT_LOGGER . cmdLineHelp ( ) ) ; og . addOption ( x ) ; og . addOption ( c ) ; og . addOption ( r ) ; og . addOption ( h ) ; og . setRequired ( true ) ; options . addOptionGroup ( og ) ; }


Input: ContainedImpl implementation ---------------------------------- [CODESPLIT] public Description describe ( ) { String defined_in_id = "IR" ; if ( defined_in instanceof ContainedOperations ) defined_in_id = ( ( ContainedOperations ) defined_in ) . id ( ) ; TypeDescription td = new TypeDescription ( name , id , defined_in_id , version , typeCode ) ; Any any = getORB ( ) . create_any ( ) ; TypeDescriptionHelper . insert ( any , td ) ; return new Description ( DefinitionKind . dk_Typedef , any ) ; }


Input: { [CODESPLIT] @ Override public void readElement ( final XMLExtendedStreamReader reader , final List < ModelNode > list ) throws XMLStreamException { ParseUtils . requireNoAttributes ( reader ) ; ParseUtils . requireNoContent ( reader ) ; final ModelNode ejb3Subsystem = new ModelNode ( ) ; ejb3Subsystem . get ( OP ) . set ( ADD ) ; ejb3Subsystem . get ( OP_ADDR ) . add ( SUBSYSTEM , EJB3Extension . SUBSYSTEM_NAME ) ; list . add ( ejb3Subsystem ) ; }


Input: Obtain debug information from the servlet request object [CODESPLIT] private static String deriveUsefulInfo ( HttpServletRequest httpRequest ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "[" ) . append ( httpRequest . getContextPath ( ) ) ; sb . append ( ":cookies=" ) . append ( Arrays . toString ( httpRequest . getCookies ( ) ) ) . append ( ":headers=" ) ; // Append Header information Enumeration < ? > en = httpRequest . getHeaderNames ( ) ; while ( en . hasMoreElements ( ) ) { String headerName = ( String ) en . nextElement ( ) ; sb . append ( headerName ) . append ( "=" ) ; // Ensure HTTP Basic Password is not logged if ( ! headerName . contains ( "authorization" ) ) { sb . append ( httpRequest . getHeader ( headerName ) ) . append ( "," ) ; } } sb . append ( "]" ) ; // Append Request parameter information sb . append ( "[parameters=" ) ; Enumeration < ? > enparam = httpRequest . getParameterNames ( ) ; while ( enparam . hasMoreElements ( ) ) { String paramName = ( String ) enparam . nextElement ( ) ; String [ ] paramValues = httpRequest . getParameterValues ( paramName ) ; int len = paramValues != null ? paramValues . length : 0 ; for ( int i = 0 ; i < len ; i ++ ) { sb . append ( paramValues [ i ] ) . append ( "::" ) ; } sb . append ( "," ) ; } sb . append ( "][attributes=" ) ; // Append Request attribute information Enumeration < ? > enu = httpRequest . getAttributeNames ( ) ; while ( enu . hasMoreElements ( ) ) { String attrName = ( String ) enu . nextElement ( ) ; sb . append ( attrName ) . append ( "=" ) ; sb . append ( httpRequest . getAttribute ( attrName ) ) . append ( "," ) ; } sb . append ( "]" ) ; return sb . toString ( ) ; }


Input: { @inheritDoc } [CODESPLIT] @ Override public String getSessionCookieName ( ) { SessionCookieConfig override = server . getServletContainer ( ) . getSessionCookieConfig ( ) ; if ( override == null || override . getName ( ) == null ) { return io . undertow . server . session . SessionCookieConfig . DEFAULT_SESSION_ID ; } return override . getName ( ) ; }


Input: Collect a JDR report when run outside the Application Server . [CODESPLIT] public JdrReport standaloneCollect ( CLI cli , String protocol , String host , int port ) throws OperationFailedException { return new JdrRunner ( cli , protocol , host , port , null , null ) . collect ( ) ; }


Input: Collect a JDR report . [CODESPLIT] public JdrReport collect ( ) throws OperationFailedException { JdrRunner runner = new JdrRunner ( true ) ; serverEnvironment = serverEnvironmentValue . getValue ( ) ; runner . setJbossHomeDir ( serverEnvironment . getHomeDir ( ) . getAbsolutePath ( ) ) ; runner . setReportLocationDir ( serverEnvironment . getServerTempDir ( ) . getAbsolutePath ( ) ) ; runner . setControllerClient ( controllerClient ) ; runner . setHostControllerName ( serverEnvironment . getHostControllerName ( ) ) ; runner . setServerName ( serverEnvironment . getServerName ( ) ) ; return runner . collect ( ) ; }


Input: Register a resource adapter deployment [CODESPLIT] public void registerResourceAdapterDeployment ( ResourceAdapterDeployment deployment ) { if ( deployment == null ) throw new IllegalArgumentException ( ConnectorLogger . ROOT_LOGGER . nullVar ( "Deployment" ) ) ; DEPLOYMENT_CONNECTOR_REGISTRY_LOGGER . tracef ( "Adding deployment: %s" , deployment ) ; deployments . add ( deployment ) ; }


Input: Unregister a resource adapter deployment [CODESPLIT] public void unregisterResourceAdapterDeployment ( ResourceAdapterDeployment deployment ) { if ( deployment == null ) throw new IllegalArgumentException ( ConnectorLogger . ROOT_LOGGER . nullVar ( "Deployment" ) ) ; DEPLOYMENT_CONNECTOR_REGISTRY_LOGGER . tracef ( "Removing deployment: %s" , deployment ) ; deployments . remove ( deployment ) ; }


Input: { [CODESPLIT] @ Override protected void performBoottime ( OperationContext context , ModelNode operation , Resource resource ) throws OperationFailedException { try { Class . forName ( "org.apache.jasper.compiler.JspRuntimeContext" , true , this . getClass ( ) . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { UndertowLogger . ROOT_LOGGER . couldNotInitJsp ( e ) ; } final ModelNode model = resource . getModel ( ) ; final String defaultVirtualHost = UndertowRootDefinition . DEFAULT_VIRTUAL_HOST . resolveModelAttribute ( context , model ) . asString ( ) ; final String defaultContainer = UndertowRootDefinition . DEFAULT_SERVLET_CONTAINER . resolveModelAttribute ( context , model ) . asString ( ) ; final String defaultServer = UndertowRootDefinition . DEFAULT_SERVER . resolveModelAttribute ( context , model ) . asString ( ) ; final boolean stats = UndertowRootDefinition . STATISTICS_ENABLED . resolveModelAttribute ( context , model ) . asBoolean ( ) ; final String defaultSecurityDomain = UndertowRootDefinition . DEFAULT_SECURITY_DOMAIN . resolveModelAttribute ( context , model ) . asString ( ) ; final ModelNode instanceIdModel = UndertowRootDefinition . INSTANCE_ID . resolveModelAttribute ( context , model ) ; final String instanceId = instanceIdModel . isDefined ( ) ? instanceIdModel . asString ( ) : null ; DefaultDeploymentMappingProvider . instance ( ) . clear ( ) ; //we clear provider on system boot, as on reload it could cause issues. context . getCapabilityServiceTarget ( ) . addCapability ( UndertowRootDefinition . UNDERTOW_CAPABILITY , new UndertowService ( defaultContainer , defaultServer , defaultVirtualHost , instanceId , stats ) ) . setInitialMode ( ServiceController . Mode . ACTIVE ) . addAliases ( UndertowService . UNDERTOW ) . install ( ) ; context . addStep ( new AbstractDeploymentChainStep ( ) { @ Override protected void execute ( DeploymentProcessorTarget processorTarget ) { final SharedTldsMetaDataBuilder sharedTldsBuilder = new SharedTldsMetaDataBuilder ( model . clone ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . STRUCTURE , Phase . STRUCTURE_EXPLODED_MOUNT , new DeploymentRootExplodedMountProcessor ( ) ) ; JBossAllXmlParserRegisteringProcessor . Builder builder = JBossAllXmlParserRegisteringProcessor . builder ( ) ; for ( SharedSessionConfigSchema schema : EnumSet . allOf ( SharedSessionConfigSchema . class ) ) { builder . addParser ( schema . getRoot ( ) , SharedSessionManagerConfig . ATTACHMENT_KEY , new SharedSessionConfigParser ( schema ) ) ; } processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . STRUCTURE , Phase . STRUCTURE_REGISTER_JBOSS_ALL_UNDERTOW_SHARED_SESSION , builder . build ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . STRUCTURE , Phase . STRUCTURE_REGISTER_JBOSS_ALL_WEB , new JBossAllXmlParserRegisteringProcessor <> ( WebJBossAllParser . ROOT_ELEMENT , WebJBossAllParser . ATTACHMENT_KEY , new WebJBossAllParser ( ) ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . STRUCTURE , Phase . STRUCTURE_WAR_DEPLOYMENT_INIT , new WarDeploymentInitializingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . STRUCTURE , Phase . STRUCTURE_WAR , new WarStructureDeploymentProcessor ( sharedTldsBuilder ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_WEB_DEPLOYMENT , new WebParsingDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_WEB_DEPLOYMENT_FRAGMENT , new WebFragmentParsingDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_JBOSS_WEB_DEPLOYMENT , new JBossWebParsingDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_ANNOTATION_WAR , new WarAnnotationDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_EAR_CONTEXT_ROOT , new EarContextRootProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_WEB_MERGE_METADATA , new WarMetaDataProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_WEB_MERGE_METADATA + 1 , new TldParsingDeploymentProcessor ( ) ) ; //todo: fix priority processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_WEB_MERGE_METADATA + 2 , new org . wildfly . extension . undertow . deployment . WebComponentProcessor ( ) ) ; //todo: fix priority processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . PARSE , Phase . PARSE_WEB_MERGE_METADATA + 3 , new DefaultSecurityDomainProcessor ( defaultSecurityDomain ) ) ; //todo: fix priority processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . DEPENDENCIES , Phase . DEPENDENCIES_WAR_MODULE , new UndertowDependencyProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . POST_MODULE , Phase . POST_MODULE_UNDERTOW_WEBSOCKETS , new UndertowJSRWebSocketDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . POST_MODULE , Phase . POST_MODULE_UNDERTOW_HANDLERS , new UndertowHandlersDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . POST_MODULE , Phase . POST_MODULE_UNDERTOW_HANDLERS + 1 , new ExternalTldParsingDeploymentProcessor ( ) ) ; //todo: fix priority processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . POST_MODULE , Phase . POST_MODULE_UNDERTOW_HANDLERS + 2 , new UndertowServletContainerDependencyProcessor ( defaultContainer ) ) ; //todo: fix priority processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . INSTALL , Phase . INSTALL_SHARED_SESSION_MANAGER , new SharedSessionManagerDeploymentProcessor ( defaultServer ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . INSTALL , Phase . INSTALL_SERVLET_INIT_DEPLOYMENT , new ServletContainerInitializerDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( UndertowExtension . SUBSYSTEM_NAME , Phase . INSTALL , Phase . INSTALL_WAR_DEPLOYMENT , new UndertowDeploymentProcessor ( defaultVirtualHost , defaultContainer , defaultServer , defaultSecurityDomain , knownSecurityDomain ) ) ; } } , OperationContext . Stage . RUNTIME ) ; context . getCapabilityServiceTarget ( ) . addCapability ( HTTP_INVOKER_RUNTIME_CAPABILITY , new RemoteHttpInvokerService ( ) ) . install ( ) ; }


Input: <p > JASPIC 1 . 1 specification : if there is an { @code AuthConfigProvider } for the { @code HttpServlet } layer and application context then @ { @code login } must throw a { @code ServletException } which may convey that the exception was caused by an incompatibility between the { @code login } method and the configured authentication mechanism . If there is no such provider then the container must proceed with the regular { @code login } processing . < / p > [CODESPLIT] @ Override public boolean login ( final String username , final String password ) { // if there is an AuthConfigProvider for the HttpServlet layer and appContext, this method must throw an exception. String appContext = this . buildAppContext ( ) ; AuthConfigProvider provider = AuthConfigFactory . getFactory ( ) . getConfigProvider ( layer , appContext , null ) ; if ( provider != null ) { ServletException se = new ServletException ( "login is not supported by the JASPIC mechanism" ) ; throw new SecurityException ( se ) ; } return super . login ( username , password ) ; }


Input: <p > JASPIC 1 . 1 specification : if there is an { [CODESPLIT] @ Override public void logout ( ) { if ( ! isAuthenticated ( ) ) return ; // call cleanSubject() if there is an AuthConfigProvider for the HttpServlet layer and appContext. String appContext = this . buildAppContext ( ) ; if ( AuthConfigFactory . getFactory ( ) . getConfigProvider ( layer , appContext , null ) != null ) { Subject authenticatedSubject = this . getAuthenticatedSubject ( ) ; MessageInfo messageInfo = this . buildMessageInfo ( ) ; this . manager . cleanSubject ( messageInfo , authenticatedSubject , layer , appContext , handler ) ; } // following the return from cleanSubject(), logout must perform the regular logout processing. super . logout ( ) ; }


Input: <p > Overrides the parent method to return the cached authenticated account ( that is the account that was set in the session as a result of a SAM setting the { @code javax . servlet . http . registerSession } property ) when the regular account is null . This allows a SAM to retrieve the cached account principal by calling { @code getUserPrincipal () } on { @code HttpServletRequest } . < / p > [CODESPLIT] @ Override public Account getAuthenticatedAccount ( ) { Account account = super . getAuthenticatedAccount ( ) ; if ( account == null ) account = this . cachedAuthenticatedAccount ; return account ; }


Input: <p > Builds the JASPIC application context . < / p > [CODESPLIT] private String buildAppContext ( ) { final ServletRequestContext requestContext = exchange . getAttachment ( ServletRequestContext . ATTACHMENT_KEY ) ; ServletRequest servletRequest = requestContext . getServletRequest ( ) ; return servletRequest . getServletContext ( ) . getVirtualServerName ( ) + " " + servletRequest . getServletContext ( ) . getContextPath ( ) ; }


Input: <p > Builds the { @code MessageInfo } instance for the { @code cleanSubject () } call . < / p > [CODESPLIT] private MessageInfo buildMessageInfo ( ) { ServletRequestContext servletRequestContext = exchange . getAttachment ( ServletRequestContext . ATTACHMENT_KEY ) ; GenericMessageInfo messageInfo = new GenericMessageInfo ( ) ; messageInfo . setRequestMessage ( servletRequestContext . getServletRequest ( ) ) ; messageInfo . setResponseMessage ( servletRequestContext . getServletResponse ( ) ) ; // when calling cleanSubject, isMandatory must be set to true. messageInfo . getMap ( ) . put ( "javax.security.auth.message.MessagePolicy.isMandatory" , "true" ) ; return messageInfo ; }


Input: <p > Retrieves the authenticated subject from the underlying security context . < / p > [CODESPLIT] private Subject getAuthenticatedSubject ( ) { Subject subject = null ; org . jboss . security . SecurityContext picketBoxContext = SecurityActions . getSecurityContext ( ) ; if ( picketBoxContext != null && picketBoxContext . getSubjectInfo ( ) != null ) subject = picketBoxContext . getSubjectInfo ( ) . getAuthenticatedSubject ( ) ; return subject != null ? subject : new Subject ( ) ; }


Input: Reads a { @code name } attribute on an element . [CODESPLIT] static String readNameAttribute ( final XMLExtendedStreamReader reader ) throws XMLStreamException { return readRequiredAttributes ( reader , EnumSet . of ( Attribute . NAME ) ) . get ( Attribute . NAME ) ; }


Input: Reads a { @code value } attribute on an element . [CODESPLIT] static String readValueAttribute ( final XMLExtendedStreamReader reader ) throws XMLStreamException { return readRequiredAttributes ( reader , EnumSet . of ( Attribute . VALUE ) ) . get ( Attribute . VALUE ) ; }


Input: Reads the required attributes from an XML configuration . <p > The reader must be on an element with attributes . < / p > [CODESPLIT] static Map < Attribute , String > readRequiredAttributes ( final XMLExtendedStreamReader reader , final Set < Attribute > attributes ) throws XMLStreamException { final int attributeCount = reader . getAttributeCount ( ) ; final Map < Attribute , String > result = new EnumMap <> ( Attribute . class ) ; for ( int i = 0 ; i < attributeCount ; i ++ ) { final Attribute current = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; if ( attributes . contains ( current ) ) { if ( result . put ( current , reader . getAttributeValue ( i ) ) != null ) { throw ParseUtils . duplicateAttribute ( reader , current . getLocalName ( ) ) ; } } else { throw ParseUtils . unexpectedAttribute ( reader , i , attributes . stream ( ) . map ( Attribute :: getLocalName ) . collect ( Collectors . toSet ( ) ) ) ; } } if ( result . isEmpty ( ) ) { throw ParseUtils . missingRequired ( reader , attributes . stream ( ) . map ( Attribute :: getLocalName ) . collect ( Collectors . toSet ( ) ) ) ; } return result ; }


Input: Add dependencies for modules required for JPA deployments [CODESPLIT] public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( Attachments . MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; // all applications get the javax.persistence module added to their deplyoment by default addDependency ( moduleSpecification , moduleLoader , deploymentUnit , JAVAX_PERSISTENCE_API_ID , HIBERNATE_TRANSFORMER_ID ) ; if ( ! JPADeploymentMarker . isJPADeployment ( deploymentUnit ) ) { return ; // Skip if there are no persistence use in the deployment } addDependency ( moduleSpecification , moduleLoader , deploymentUnit , JBOSS_AS_JPA_ID , JBOSS_AS_JPA_SPI_ID ) ; addPersistenceProviderModuleDependencies ( phaseContext , moduleSpecification , moduleLoader ) ; }


Input: Add the <code > puServiceName< / code > as a dependency on each of the passed <code > components< / code > [CODESPLIT] private static void addPUServiceDependencyToComponents ( final Collection < ComponentDescription > components , final PersistenceUnitMetadataHolder holder ) { if ( components == null || components . isEmpty ( ) || holder == null ) { return ; } for ( PersistenceUnitMetadata pu : holder . getPersistenceUnits ( ) ) { String jpaContainerManaged = pu . getProperties ( ) . getProperty ( Configuration . JPA_CONTAINER_MANAGED ) ; boolean deployPU = ( jpaContainerManaged == null ? true : Boolean . parseBoolean ( jpaContainerManaged ) ) ; if ( deployPU ) { final ServiceName puServiceName = PersistenceUnitServiceImpl . getPUServiceName ( pu ) ; for ( final ComponentDescription component : components ) { ROOT_LOGGER . debugf ( "Adding dependency on PU service %s for component %s" , puServiceName , component . getComponentClassName ( ) ) ; component . addDependency ( puServiceName ) ; } } } }


Input: Register the transformers for the 1 . 3 . 0 version . [CODESPLIT] protected static void registerTransformers ( final SubsystemRegistration subsystem ) { ChainedTransformationDescriptionBuilder chained = ResourceTransformationDescriptionBuilder . Factory . createChainedSubystemInstance ( CURRENT_MODEL_VERSION ) ; ModelVersion MODEL_VERSION_EAP64 = ModelVersion . create ( 1 , 4 , 0 ) ; ModelVersion MODEL_VERSION_EAP63 = ModelVersion . create ( 1 , 3 , 0 ) ; //also EAP6.2 ResourceTransformationDescriptionBuilder builder64 = chained . createBuilder ( CURRENT_MODEL_VERSION , MODEL_VERSION_EAP64 ) ; builder64 . getAttributeBuilder ( ) . addRejectCheck ( RejectAttributeChecker . DEFINED , JacORBSubsystemDefinitions . PERSISTENT_SERVER_ID ) . setDiscard ( new DiscardAttributeChecker . DiscardAttributeValueChecker ( JacORBSubsystemDefinitions . PERSISTENT_SERVER_ID . getDefaultValue ( ) ) , JacORBSubsystemDefinitions . PERSISTENT_SERVER_ID ) . setValueConverter ( new AttributeConverter . DefaultValueAttributeConverter ( JacORBSubsystemDefinitions . INTEROP_CHUNK_RMI_VALUETYPES ) , JacORBSubsystemDefinitions . INTEROP_CHUNK_RMI_VALUETYPES ) ; ResourceTransformationDescriptionBuilder builder63 = chained . createBuilder ( MODEL_VERSION_EAP64 , MODEL_VERSION_EAP63 ) ; builder63 . getAttributeBuilder ( ) . addRejectCheck ( RejectAttributeChecker . DEFINED , IORTransportConfigDefinition . ATTRIBUTES . toArray ( new AttributeDefinition [ 0 ] ) ) . addRejectCheck ( RejectAttributeChecker . DEFINED , IORASContextDefinition . ATTRIBUTES . toArray ( new AttributeDefinition [ 0 ] ) ) . addRejectCheck ( RejectAttributeChecker . DEFINED , IORSASContextDefinition . ATTRIBUTES . toArray ( new AttributeDefinition [ 0 ] ) ) . end ( ) . rejectChildResource ( IORSettingsDefinition . INSTANCE . getPathElement ( ) ) ; chained . buildAndRegister ( subsystem , new ModelVersion [ ] { MODEL_VERSION_EAP64 , MODEL_VERSION_EAP63 } ) ; }


Input: Returns an <code > StubStrategy< / code > for a method given descriptions of the method parameters exceptions and return value . Parameter and return value descriptions are marshaller abbreviated names . [CODESPLIT] public static StubStrategy forMethod ( String [ ] paramTypes , String [ ] excepIds , String [ ] excepTypes , String retvalType , ClassLoader cl ) { // This "factory method" exists just because I have found it easier // to invoke a static method (rather than invoking operator new) // from a stub class dynamically assembled by an instance of // org.jboss.proxy.ProxyAssembler. return new StubStrategy ( paramTypes , excepIds , excepTypes , retvalType , cl ) ; }


Input: Marshals the sequence of method parameters into an output stream . [CODESPLIT] public void writeParams ( OutputStream out , Object [ ] params ) { int len = params . length ; if ( len != paramWriters . length ) { throw IIOPLogger . ROOT_LOGGER . errorMashalingParams ( ) ; } for ( int i = 0 ; i < len ; i ++ ) { Object param = params [ i ] ; if ( param instanceof PortableRemoteObject ) { try { param = PortableRemoteObject . toStub ( ( Remote ) param ) ; } catch ( NoSuchObjectException e ) { throw new RuntimeException ( e ) ; } } paramWriters [ i ] . write ( out , RemoteObjectSubstitutionManager . writeReplaceRemote ( param ) ) ; } }


Input: Unmarshals from an input stream an exception thrown by the method . [CODESPLIT] public Exception readException ( String id , InputStream in ) { ExceptionReader exceptionReader = ( ExceptionReader ) exceptionMap . get ( id ) ; if ( exceptionReader == null ) { return new UnexpectedException ( id ) ; } else { return exceptionReader . read ( in ) ; } }


Input: Checks if a given <code > Throwable< / code > instance corresponds to an exception declared by this <code > StubStrategy< / code > s method . [CODESPLIT] public boolean isDeclaredException ( Throwable t ) { Iterator < Class < ? > > iterator = exceptionList . iterator ( ) ; while ( iterator . hasNext ( ) ) { if ( ( ( Class < ? > ) iterator . next ( ) ) . isInstance ( t ) ) { return true ; } } return false ; }


Input: Converts the return value of a local invocation into the expected type . A conversion is needed if the return value is a remote interface ( in this case <code > PortableRemoteObject . narrow () < / code > must be called ) . [CODESPLIT] public Object convertLocalRetval ( Object obj ) { if ( retvalRemoteInterface == null ) return obj ; else return PortableRemoteObject . narrow ( obj , retvalRemoteInterface ) ; }


Input: { [CODESPLIT] @ Override public synchronized void start ( StartContext context ) throws StartException { if ( createQueue ) { try { final ActiveMQServer server = this . activeMQServerSupplier . get ( ) ; MessagingLogger . ROOT_LOGGER . debugf ( "Deploying queue on server %s with address: %s ,  name: %s, filter: %s ands durable: %s, temporary: %s" , server . getNodeID ( ) , new SimpleString ( queueConfiguration . getAddress ( ) ) , new SimpleString ( queueConfiguration . getName ( ) ) , SimpleString . toSimpleString ( queueConfiguration . getFilterString ( ) ) , queueConfiguration . isDurable ( ) , temporary ) ; final SimpleString resourceName = new SimpleString ( queueConfiguration . getName ( ) ) ; final SimpleString address = new SimpleString ( queueConfiguration . getAddress ( ) ) ; final SimpleString filterString = SimpleString . toSimpleString ( queueConfiguration . getFilterString ( ) ) ; server . createQueue ( address , queueConfiguration . getRoutingType ( ) , resourceName , filterString , queueConfiguration . isDurable ( ) , temporary ) ; } catch ( Exception e ) { throw new StartException ( e ) ; } } }


Input: { [CODESPLIT] @ Override public synchronized void stop ( StopContext context ) { try { final ActiveMQServer server = this . activeMQServerSupplier . get ( ) ; server . destroyQueue ( new SimpleString ( queueConfiguration . getName ( ) ) , null , false ) ; MessagingLogger . ROOT_LOGGER . debugf ( "Destroying queue from server %s queue with name: %s" , server . getNodeID ( ) , new SimpleString ( queueConfiguration . getName ( ) ) ) ; } catch ( Exception e ) { MessagingLogger . ROOT_LOGGER . failedToDestroy ( "queue" , queueConfiguration . getName ( ) ) ; } }


Input: Returns all interfaces implemented by a bean that are eligible to be view interfaces [CODESPLIT] static Set < Class < ? > > getPotentialViewInterfaces ( Class < ? > beanClass ) { Class < ? > [ ] interfaces = beanClass . getInterfaces ( ) ; if ( interfaces == null ) { return Collections . emptySet ( ) ; } final Set < Class < ? > > potentialBusinessInterfaces = new HashSet < Class < ? > > ( ) ; for ( Class < ? > klass : interfaces ) { // EJB 3.1 FR 4.9.7 bullet 5.3 if ( klass . equals ( Serializable . class ) || klass . equals ( Externalizable . class ) || klass . getName ( ) . startsWith ( "javax.ejb." ) || klass . getName ( ) . startsWith ( "groovy.lang." ) ) { continue ; } potentialBusinessInterfaces . add ( klass ) ; } return potentialBusinessInterfaces ; }


Input: Returns all interfaces implemented by a bean that are eligible to be view interfaces [CODESPLIT] static Set < DotName > getPotentialViewInterfaces ( ClassInfo beanClass ) { DotName [ ] interfaces = beanClass . interfaces ( ) ; if ( interfaces == null ) { return Collections . emptySet ( ) ; } final Set < DotName > names = new HashSet < DotName > ( ) ; for ( DotName dotName : interfaces ) { String name = dotName . toString ( ) ; // EJB 3.1 FR 4.9.7 bullet 5.3 // & FR 5.4.2 if ( name . equals ( Serializable . class . getName ( ) ) || name . equals ( Externalizable . class . getName ( ) ) || name . startsWith ( "javax.ejb." ) || name . startsWith ( "groovy.lang." ) ) { continue ; } names . add ( dotName ) ; } return names ; }


Input: Save the specified EntityManager in the local threads active transaction . The TransactionSynchronizationRegistry will clear the reference to the EntityManager when the transaction completes . [CODESPLIT] public static void putEntityManagerInTransactionRegistry ( String scopedPuName , EntityManager entityManager , TransactionSynchronizationRegistry tsr ) { tsr . putResource ( scopedPuName , entityManager ) ; }


Input: TODO use a custom attribute marshaller [CODESPLIT] private static void writeFilter ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { if ( node . hasDefined ( CommonAttributes . FILTER . getName ( ) ) ) { writer . writeEmptyElement ( CommonAttributes . FILTER . getXmlName ( ) ) ; writer . writeAttribute ( CommonAttributes . STRING , node . get ( CommonAttributes . FILTER . getName ( ) ) . asString ( ) ) ; } }


Input: Generate the Jar processing order . [CODESPLIT] protected static void resolveOrder ( List < WebOrdering > webOrderings , List < String > order ) { List < Ordering > work = new ArrayList < Ordering > ( ) ; // Populate the work Ordering list Iterator < WebOrdering > webOrderingsIterator = webOrderings . iterator ( ) ; while ( webOrderingsIterator . hasNext ( ) ) { WebOrdering webOrdering = webOrderingsIterator . next ( ) ; Ordering ordering = new Ordering ( ) ; ordering . ordering = webOrdering ; ordering . afterOthers = webOrdering . isAfterOthers ( ) ; ordering . beforeOthers = webOrdering . isBeforeOthers ( ) ; if ( ordering . afterOthers && ordering . beforeOthers ) { // Cannot be both after and before others throw new IllegalStateException ( UndertowLogger . ROOT_LOGGER . invalidRelativeOrderingBeforeAndAfter ( webOrdering . getJar ( ) ) ) ; } work . add ( ordering ) ; } // Create double linked relationships between the orderings, // and resolve names Iterator < Ordering > workIterator = work . iterator ( ) ; while ( workIterator . hasNext ( ) ) { Ordering ordering = workIterator . next ( ) ; WebOrdering webOrdering = ordering . ordering ; Iterator < String > after = webOrdering . getAfter ( ) . iterator ( ) ; while ( after . hasNext ( ) ) { String name = after . next ( ) ; Iterator < Ordering > workIterator2 = work . iterator ( ) ; boolean found = false ; while ( workIterator2 . hasNext ( ) ) { Ordering ordering2 = workIterator2 . next ( ) ; if ( name . equals ( ordering2 . ordering . getName ( ) ) ) { if ( found ) { // Duplicate name throw new IllegalStateException ( UndertowLogger . ROOT_LOGGER . invalidRelativeOrderingDuplicateName ( webOrdering . getJar ( ) ) ) ; } ordering . addAfter ( ordering2 ) ; ordering2 . addBefore ( ordering ) ; found = true ; } } if ( ! found ) { // Unknown name UndertowLogger . ROOT_LOGGER . invalidRelativeOrderingUnknownName ( webOrdering . getJar ( ) ) ; } } Iterator < String > before = webOrdering . getBefore ( ) . iterator ( ) ; while ( before . hasNext ( ) ) { String name = before . next ( ) ; Iterator < Ordering > workIterator2 = work . iterator ( ) ; boolean found = false ; while ( workIterator2 . hasNext ( ) ) { Ordering ordering2 = workIterator2 . next ( ) ; if ( name . equals ( ordering2 . ordering . getName ( ) ) ) { if ( found ) { // Duplicate name throw new IllegalStateException ( UndertowLogger . ROOT_LOGGER . invalidRelativeOrderingDuplicateName ( webOrdering . getJar ( ) ) ) ; } ordering . addBefore ( ordering2 ) ; ordering2 . addAfter ( ordering ) ; found = true ; } } if ( ! found ) { // Unknown name UndertowLogger . ROOT_LOGGER . invalidRelativeOrderingUnknownName ( webOrdering . getJar ( ) ) ; } } } // Validate ordering workIterator = work . iterator ( ) ; while ( workIterator . hasNext ( ) ) { workIterator . next ( ) . validate ( ) ; } // Create three ordered lists that will then be merged List < Ordering > tempOrder = new ArrayList < Ordering > ( ) ; // Create the ordered list of fragments which are before others workIterator = work . iterator ( ) ; while ( workIterator . hasNext ( ) ) { Ordering ordering = workIterator . next ( ) ; if ( ordering . beforeOthers ) { // Insert at the first possible position int insertAfter = - 1 ; boolean last = ordering . isLastBeforeOthers ( ) ; int lastBeforeOthers = - 1 ; for ( int i = 0 ; i < tempOrder . size ( ) ; i ++ ) { if ( ordering . isAfter ( tempOrder . get ( i ) ) ) { insertAfter = i ; } if ( tempOrder . get ( i ) . beforeOthers ) { lastBeforeOthers = i ; } } int pos = insertAfter ; if ( last && lastBeforeOthers > insertAfter ) { pos = lastBeforeOthers ; } tempOrder . add ( pos + 1 , ordering ) ; } else if ( ordering . afterOthers ) { // Insert at the last possible element int insertBefore = tempOrder . size ( ) ; boolean first = ordering . isFirstAfterOthers ( ) ; int firstAfterOthers = tempOrder . size ( ) ; for ( int i = tempOrder . size ( ) - 1 ; i >= 0 ; i -- ) { if ( ordering . isBefore ( tempOrder . get ( i ) ) ) { insertBefore = i ; } if ( tempOrder . get ( i ) . afterOthers ) { firstAfterOthers = i ; } } int pos = insertBefore ; if ( first && firstAfterOthers < insertBefore ) { pos = firstAfterOthers ; } tempOrder . add ( pos , ordering ) ; } else { // Insert according to other already inserted elements int insertAfter = - 1 ; int insertBefore = tempOrder . size ( ) ; for ( int i = 0 ; i < tempOrder . size ( ) ; i ++ ) { if ( ordering . isAfter ( tempOrder . get ( i ) ) || tempOrder . get ( i ) . beforeOthers ) { insertAfter = i ; } if ( ordering . isBefore ( tempOrder . get ( i ) ) || tempOrder . get ( i ) . afterOthers ) { insertBefore = i ; } } if ( insertAfter > insertBefore ) { // Conflicting order (probably caught earlier) throw new IllegalStateException ( UndertowLogger . ROOT_LOGGER . invalidRelativeOrderingConflict ( ordering . ordering . getJar ( ) ) ) ; } // Insert somewhere in the range tempOrder . add ( insertAfter + 1 , ordering ) ; } } // Create the final ordered list Iterator < Ordering > tempOrderIterator = tempOrder . iterator ( ) ; while ( tempOrderIterator . hasNext ( ) ) { Ordering ordering = tempOrderIterator . next ( ) ; order . add ( ordering . ordering . getJar ( ) ) ; } }


Input: Create a JBoss Security Context with the given security domain name [CODESPLIT] private static SecurityContext createSecurityContext ( final String domain ) { return AccessController . doPrivileged ( new PrivilegedAction < SecurityContext > ( ) { @ Override public SecurityContext run ( ) { try { return SecurityContextFactory . createSecurityContext ( domain ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } } ) ; }


Input: Set the { @code SecurityContext } on the { @code SecurityContextAssociation } [CODESPLIT] private static void setSecurityContextOnAssociation ( final SecurityContext sc ) { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { SecurityContextAssociation . setSecurityContext ( sc ) ; return null ; } } ) ; }


Input: { [CODESPLIT] public void writeContent ( final XMLExtendedStreamWriter writer , final SubsystemMarshallingContext context ) throws XMLStreamException { context . startSubsystemElement ( org . jboss . as . jdr . Namespace . CURRENT . getUriString ( ) , false ) ; writer . writeEndElement ( ) ; }


Input: adds a key / value parameter pair to the call [CODESPLIT] public CallAS7 param ( String key , String val ) { this . parameters . put ( key , val ) ; return this ; }


Input: appends resource parts to the resource to call <p > < / p > If you want to call / foo = bar / baz = boo / do this : <pre > . resource ( foo bar baz boo ) < / pre > [CODESPLIT] public CallAS7 resource ( String ... parts ) { for ( String part : parts ) { this . resource . add ( part ) ; } return this ; }


Input: Use either the active transaction or the current thread as the lock owner [CODESPLIT] private static Object getLockOwner ( final TransactionSynchronizationRegistry transactionSynchronizationRegistry ) { Object owner = transactionSynchronizationRegistry . getTransactionKey ( ) ; return owner != null ? owner : Thread . currentThread ( ) ; }


Input: Releases the passed { @link StatefulSessionComponentInstance } i . e . marks it as no longer in use . After releasing the instance this method releases the lock held by this thread on the stateful component instance . [CODESPLIT] static void releaseInstance ( final StatefulSessionComponentInstance instance , boolean toDiscard ) { try { if ( ! instance . isDiscarded ( ) && ! toDiscard ) { // mark the SFSB instance as no longer in use instance . getComponent ( ) . getCache ( ) . release ( instance ) ; } } finally { instance . setSynchronizationRegistered ( false ) ; // release the lock on the SFSB instance releaseLock ( instance ) ; } }


Input: Releases the lock held by this thread on the stateful component instance . [CODESPLIT] static void releaseLock ( final StatefulSessionComponentInstance instance ) { instance . getLock ( ) . unlock ( getLockOwner ( instance . getComponent ( ) . getTransactionSynchronizationRegistry ( ) ) ) ; ROOT_LOGGER . tracef ( "Released lock: %s" , instance . getLock ( ) ) ; }


Input: Adds the contents of the { @link InputStream } to the path in the zip . [CODESPLIT] public void add ( InputStream is , String path ) { byte [ ] buffer = new byte [ 1024 ] ; try { String entryName = this . baseName + "/" + path ; ZipEntry ze = new ZipEntry ( entryName ) ; zos . putNextEntry ( ze ) ; int bytesRead = is . read ( buffer ) ; while ( bytesRead > - 1 ) { zos . write ( buffer , 0 , bytesRead ) ; bytesRead = is . read ( buffer ) ; } } catch ( ZipException ze ) { ROOT_LOGGER . debugf ( ze , "%s is already in the zip" , path ) ; } catch ( Exception e ) { ROOT_LOGGER . debugf ( e , "Error when adding %s" , path ) ; } finally { try { zos . closeEntry ( ) ; } catch ( Exception e ) { ROOT_LOGGER . debugf ( e , "Error when closing entry for %s" , path ) ; } } }


Input: Adds the content of the { @link InputStream } to the zip in a location that mirrors where { @link VirtualFile file } is located . [CODESPLIT] public void add ( VirtualFile file , InputStream is ) throws Exception { String name = "JBOSS_HOME" + file . getPhysicalFile ( ) . getAbsolutePath ( ) . substring ( this . jbossHome . length ( ) ) ; this . add ( is , name ) ; }


Input: Adds content to the zipfile at path [CODESPLIT] public void add ( String content , String path ) throws Exception { StringBuilder name = new StringBuilder ( "sos_strings/" ) ; name . append ( this . env . getProductName ( ) . replace ( " " , "_" ) . toLowerCase ( ) ) ; name . append ( "-" ) ; name . append ( this . env . getProductVersion ( ) . split ( "\\." ) [ 0 ] ) ; name . append ( "/" ) ; name . append ( path ) ; this . add ( new ByteArrayInputStream ( content . getBytes ( StandardCharsets . UTF_8 ) ) , name . toString ( ) ) ; }


Input: Adds content to the zipfile at path [CODESPLIT] public void addAsString ( InputStream stream , String path ) throws Exception { StringBuilder name = new StringBuilder ( "sos_strings/" ) ; name . append ( this . env . getProductName ( ) . replace ( " " , "_" ) . toLowerCase ( ) ) ; name . append ( "-" ) ; name . append ( this . env . getProductVersion ( ) . split ( "\\." ) [ 0 ] ) ; name . append ( "/" ) ; name . append ( path ) ; this . add ( stream , name . toString ( ) ) ; }


Input: Adds content to the zipfile in a file named logName [CODESPLIT] public void addLog ( String content , String logName ) throws Exception { String name = "sos_logs/" + logName ; this . add ( new ByteArrayInputStream ( content . getBytes ( StandardCharsets . UTF_8 ) ) , name ) ; }


Input: <p > Creates a thread with the specified { @code Runnable } and name . < / p > [CODESPLIT] static Thread createThread ( final Runnable runnable , final String threadName ) { return ! WildFlySecurityManager . isChecking ( ) ? new Thread ( runnable , threadName ) : doPrivileged ( new CreateThreadAction ( runnable , threadName ) ) ; }


Input: / * private boolean isJSFSpecOver1_1 ( ModuleIdentifier jsfModule ModuleDependency jsfAPI ) throws DeploymentUnitProcessingException { try { return ( jsfAPI . getModuleLoader () . loadModule ( jsfModule ) . getClassLoader () . getResource ( / javax / faces / component / ActionSource2 . class ) ! = null ) ; } catch ( ModuleLoadException e ) { throw new DeploymentUnitProcessingException ( e ) ; } } [CODESPLIT] private void addJSFImpl ( String jsfVersion , ModuleSpecification moduleSpecification , ModuleLoader moduleLoader ) { if ( jsfVersion . equals ( JsfVersionMarker . WAR_BUNDLES_JSF_IMPL ) ) return ; ModuleIdentifier jsfModule = moduleIdFactory . getImplModId ( jsfVersion ) ; ModuleDependency jsfImpl = new ModuleDependency ( moduleLoader , jsfModule , false , false , true , false ) ; jsfImpl . addImportFilter ( PathFilters . getMetaInfFilter ( ) , true ) ; moduleSpecification . addSystemDependency ( jsfImpl ) ; }


Input: a CDI ViewHandler . [CODESPLIT] private void addCDIFlag ( WarMetaData warMetaData , DeploymentUnit deploymentUnit ) { JBossWebMetaData webMetaData = warMetaData . getMergedJBossWebMetaData ( ) ; if ( webMetaData == null ) { webMetaData = new JBossWebMetaData ( ) ; warMetaData . setMergedJBossWebMetaData ( webMetaData ) ; } List < ParamValueMetaData > contextParams = webMetaData . getContextParams ( ) ; if ( contextParams == null ) { contextParams = new ArrayList < ParamValueMetaData > ( ) ; } boolean isCDI = false ; final CapabilityServiceSupport support = deploymentUnit . getAttachment ( Attachments . CAPABILITY_SERVICE_SUPPORT ) ; if ( support . hasCapability ( WELD_CAPABILITY_NAME ) ) { isCDI = support . getOptionalCapabilityRuntimeAPI ( WELD_CAPABILITY_NAME , WeldCapability . class ) . get ( ) . isPartOfWeldDeployment ( deploymentUnit ) ; } ParamValueMetaData param = new ParamValueMetaData ( ) ; param . setParamName ( IS_CDI_PARAM ) ; param . setParamValue ( Boolean . toString ( isCDI ) ) ; contextParams . add ( param ) ; webMetaData . setContextParams ( contextParams ) ; }


Input: Gets endpoint container lazily . [CODESPLIT] protected ComponentView getComponentView ( ) { ComponentView cv = componentView ; // we need to check both, otherwise it is possible for // componentView to be initialized before reference if ( cv == null ) { synchronized ( this ) { cv = componentView ; if ( cv == null ) { cv = getMSCService ( componentViewName , ComponentView . class ) ; if ( cv == null ) { throw WSLogger . ROOT_LOGGER . cannotFindComponentView ( componentViewName ) ; } if ( reference == null ) { try { reference = cv . createInstance ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } componentView = cv ; } } } return cv ; }


Input: Invokes WS endpoint . [CODESPLIT] public void invoke ( final Endpoint endpoint , final Invocation wsInvocation ) throws Exception { try { if ( ! EndpointState . STARTED . equals ( endpoint . getState ( ) ) ) { throw WSLogger . ROOT_LOGGER . endpointAlreadyStopped ( endpoint . getShortName ( ) ) ; } SecurityDomainContext securityDomainContext = endpoint . getSecurityDomainContext ( ) ; securityDomainContext . runAs ( ( Callable < Void > ) ( ) -> { invokeInternal ( endpoint , wsInvocation ) ; return null ; } ) ; } catch ( Throwable t ) { handleInvocationException ( t ) ; } finally { onAfterInvocation ( wsInvocation ) ; } }


Input: Translates SEI method to component view method . [CODESPLIT] protected Method getComponentViewMethod ( final Method seiMethod , final Collection < Method > viewMethods ) { for ( final Method viewMethod : viewMethods ) { if ( matches ( seiMethod , viewMethod ) ) { return viewMethod ; } } throw new IllegalStateException ( ) ; }


Input: Compares two methods if they are identical . [CODESPLIT] private boolean matches ( final Method seiMethod , final Method viewMethod ) { if ( ! seiMethod . getName ( ) . equals ( viewMethod . getName ( ) ) ) return false ; final Class < ? > [ ] sourceParams = seiMethod . getParameterTypes ( ) ; final Class < ? > [ ] targetParams = viewMethod . getParameterTypes ( ) ; if ( sourceParams . length != targetParams . length ) return false ; for ( int i = 0 ; i < sourceParams . length ; i ++ ) { if ( ! sourceParams [ i ] . equals ( targetParams [ i ] ) ) return false ; } return true ; }


Input: Create single instance of management statistics resource per managementAdaptor version . [CODESPLIT] public static Resource createManagementStatisticsResource ( final ManagementAdaptor managementAdaptor , final String scopedPersistenceUnitName , final DeploymentUnit deploymentUnit ) { synchronized ( existingResourceDescriptionResolver ) { final EntityManagerFactoryLookup entityManagerFactoryLookup = new EntityManagerFactoryLookup ( ) ; final Statistics statistics = managementAdaptor . getStatistics ( ) ; if ( false == existingResourceDescriptionResolver . contains ( managementAdaptor . getVersion ( ) ) ) { // setup statistics (this used to be part of JPA subsystem startup) ResourceDescriptionResolver resourceDescriptionResolver = new StandardResourceDescriptionResolver ( statistics . getResourceBundleKeyPrefix ( ) , statistics . getResourceBundleName ( ) , statistics . getClass ( ) . getClassLoader ( ) ) { private ResourceDescriptionResolver fallback = JPAExtension . getResourceDescriptionResolver ( ) ; //add a fallback in case provider doesn't have all properties properly defined @ Override public String getResourceAttributeDescription ( String attributeName , Locale locale , ResourceBundle bundle ) { if ( bundle . containsKey ( getBundleKey ( attributeName ) ) ) { return super . getResourceAttributeDescription ( attributeName , locale , bundle ) ; } else { return fallback . getResourceAttributeDescription ( attributeName , locale , fallback . getResourceBundle ( locale ) ) ; } } } ; PathElement subsystemPE = PathElement . pathElement ( ModelDescriptionConstants . SUBSYSTEM , JPAExtension . SUBSYSTEM_NAME ) ; ManagementResourceRegistration deploymentResourceRegistration = deploymentUnit . getAttachment ( DeploymentModelUtils . MUTABLE_REGISTRATION_ATTACHMENT ) ; ManagementResourceRegistration deploymentSubsystemRegistration = deploymentResourceRegistration . getSubModel ( PathAddress . pathAddress ( subsystemPE ) ) ; ManagementResourceRegistration subdeploymentSubsystemRegistration = deploymentResourceRegistration . getSubModel ( PathAddress . pathAddress ( PathElement . pathElement ( ModelDescriptionConstants . SUBDEPLOYMENT ) , subsystemPE ) ) ; ManagementResourceRegistration providerResource = deploymentSubsystemRegistration . registerSubModel ( new ManagementResourceDefinition ( PathElement . pathElement ( managementAdaptor . getIdentificationLabel ( ) ) , resourceDescriptionResolver , statistics , entityManagerFactoryLookup ) ) ; providerResource . registerReadOnlyAttribute ( PersistenceUnitServiceHandler . SCOPED_UNIT_NAME , null ) ; providerResource = subdeploymentSubsystemRegistration . registerSubModel ( new ManagementResourceDefinition ( PathElement . pathElement ( managementAdaptor . getIdentificationLabel ( ) ) , resourceDescriptionResolver , statistics , entityManagerFactoryLookup ) ) ; providerResource . registerReadOnlyAttribute ( PersistenceUnitServiceHandler . SCOPED_UNIT_NAME , null ) ; existingResourceDescriptionResolver . add ( managementAdaptor . getVersion ( ) ) ; } // create (per deployment) dynamic Resource implementation that can reflect the deployment specific names (e.g. jpa entity classname/Hibernate region name) return new DynamicManagementStatisticsResource ( statistics , scopedPersistenceUnitName , managementAdaptor . getIdentificationLabel ( ) , entityManagerFactoryLookup ) ; } }


Input: { [CODESPLIT] @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { // no attributes if ( reader . getAttributeCount ( ) > 0 ) { throw unexpectedAttribute ( reader , 0 ) ; } final ModelNode address = new ModelNode ( ) ; address . add ( ModelDescriptionConstants . SUBSYSTEM , TransactionExtension . SUBSYSTEM_NAME ) ; address . protect ( ) ; final ModelNode subsystem = new ModelNode ( ) ; subsystem . get ( OP ) . set ( ADD ) ; subsystem . get ( OP_ADDR ) . set ( address ) ; list . add ( subsystem ) ; // elements final EnumSet < Element > required = EnumSet . of ( Element . RECOVERY_ENVIRONMENT , Element . CORE_ENVIRONMENT ) ; final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { switch ( Namespace . forUri ( reader . getNamespaceURI ( ) ) ) { case TRANSACTIONS_1_1 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; required . remove ( element ) ; if ( ! encountered . add ( element ) ) { throw unexpectedElement ( reader ) ; } switch ( element ) { case RECOVERY_ENVIRONMENT : { parseRecoveryEnvironmentElement ( reader , subsystem ) ; break ; } case CORE_ENVIRONMENT : { parseCoreEnvironmentElement ( reader , subsystem ) ; break ; } case COORDINATOR_ENVIRONMENT : { parseCoordinatorEnvironmentElement ( reader , subsystem ) ; break ; } case OBJECT_STORE : { parseObjectStoreEnvironmentElementAndEnrichOperation ( reader , subsystem ) ; break ; } case JTS : { parseJts ( reader , subsystem ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } break ; } default : { throw unexpectedElement ( reader ) ; } } } if ( ! required . isEmpty ( ) ) { throw missingRequiredElement ( reader , required ) ; } final ModelNode logStoreAddress = address . clone ( ) ; final ModelNode operation = new ModelNode ( ) ; operation . get ( OP ) . set ( ADD ) ; logStoreAddress . add ( LogStoreConstants . LOG_STORE , LogStoreConstants . LOG_STORE ) ; logStoreAddress . protect ( ) ; operation . get ( OP_ADDR ) . set ( logStoreAddress ) ; list . add ( operation ) ; }


Input: Get { [CODESPLIT] public InjectedValue < ExceptionSupplier < CredentialSource , Exception > > getBridgeCredentialSourceSupplierInjector ( String name ) { if ( bridgeCredentialSource . containsKey ( name ) ) { return bridgeCredentialSource . get ( name ) ; } else { InjectedValue < ExceptionSupplier < CredentialSource , Exception > > injector = new InjectedValue <> ( ) ; bridgeCredentialSource . put ( name , injector ) ; return injector ; } }


Input: <p > Interception of register work call to get transaction being imported to wildfly transacton client . <p > For importing a transaction Wildfly transaction client eventually calls { [CODESPLIT] @ Override public void registerWork ( Work work , Xid xid , long timeout ) throws WorkCompletedException { try { // jca provides timeout in milliseconds, SubordinationManager expects seconds int timeout_seconds = ( int ) timeout / 1000 ; // unlimited timeout for jca means -1 which fails in wfly client if ( timeout_seconds <= 0 ) timeout_seconds = ContextTransactionManager . getGlobalDefaultTransactionTimeout ( ) ; localTransactionContext . findOrImportTransaction ( xid , timeout_seconds ) ; } catch ( XAException xae ) { throw TransactionLogger . ROOT_LOGGER . cannotFindOrImportInflowTransaction ( xid , work , xae ) ; } jbossXATerminator . registerWork ( work , xid , timeout ) ; }


Input: <p > Start work gets imported transaction and assign it to current thread . <p > This method mimics behavior of Narayana s { [CODESPLIT] @ Override public void startWork ( Work work , Xid xid ) throws WorkCompletedException { LocalTransaction transaction = null ; try { ImportResult < LocalTransaction > transactionImportResult = localTransactionContext . findOrImportTransaction ( xid , 0 ) ; transaction = transactionImportResult . getTransaction ( ) ; ContextTransactionManager . getInstance ( ) . resume ( transaction ) ; } catch ( XAException xae ) { throw TransactionLogger . ROOT_LOGGER . cannotFindOrImportInflowTransaction ( xid , work , xae ) ; } catch ( InvalidTransactionException ite ) { throw TransactionLogger . ROOT_LOGGER . importedInflowTransactionIsInactive ( xid , work , ite ) ; } catch ( SystemException se ) { throw TransactionLogger . ROOT_LOGGER . cannotResumeInflowTransactionUnexpectedError ( transaction , work , se ) ; } }


Input: <p > Suspending transaction and canceling the work . <p > Suspend transaction has to be called on the wildfly transaction manager and the we delegate work cancellation to { [CODESPLIT] @ Override public void endWork ( Work work , Xid xid ) { jbossXATerminator . cancelWork ( work , xid ) ; try { ContextTransactionManager . getInstance ( ) . suspend ( ) ; } catch ( SystemException se ) { throw TransactionLogger . ROOT_LOGGER . cannotSuspendInflowTransactionUnexpectedError ( work , se ) ; } }


Input: <p > Calling { [CODESPLIT] @ Override public void cancelWork ( Work work , Xid xid ) { jbossXATerminator . cancelWork ( work , xid ) ; }


Input: @see org . jboss . webservices . integration . tomcat . AbstractSecurityMetaDataAccessorEJB#getSecurityDomain ( Deployment ) [CODESPLIT] public String getSecurityDomain ( final Deployment dep ) { String securityDomain = null ; for ( final EJBEndpoint ejbEndpoint : getEjbEndpoints ( dep ) ) { String nextSecurityDomain = ejbEndpoint . getSecurityDomain ( ) ; if ( nextSecurityDomain == null || nextSecurityDomain . isEmpty ( ) ) { nextSecurityDomain = null ; } securityDomain = getDomain ( securityDomain , nextSecurityDomain ) ; } if ( securityDomain == null ) { final DeploymentUnit unit = WSHelper . getRequiredAttachment ( dep , DeploymentUnit . class ) ; if ( unit . getParent ( ) != null ) { final EarMetaData jbossAppMD = unit . getParent ( ) . getAttachment ( Attachments . EAR_METADATA ) ; return jbossAppMD instanceof JBossAppMetaData ? ( ( JBossAppMetaData ) jbossAppMD ) . getSecurityDomain ( ) : null ; } } return securityDomain ; }


Input: @see org . jboss . webservices . integration . tomcat . SecurityMetaDataAccessorEJB#isSecureWsdlAccess ( Endpoint ) [CODESPLIT] public boolean isSecureWsdlAccess ( final Endpoint endpoint ) { final EJBSecurityMetaData ejbSecurityMD = this . getEjbSecurityMetaData ( endpoint ) ; final boolean hasEjbSecurityMD = ejbSecurityMD != null ; return hasEjbSecurityMD ? ejbSecurityMD . getSecureWSDLAccess ( ) : false ; }


Input: @see org . jboss . webservices . integration . tomcat . SecurityMetaDataAccessorEJB#getTransportGuarantee ( Endpoint ) [CODESPLIT] public String getTransportGuarantee ( final Endpoint endpoint ) { final EJBSecurityMetaData ejbSecurityMD = this . getEjbSecurityMetaData ( endpoint ) ; final boolean hasEjbSecurityMD = ejbSecurityMD != null ; return hasEjbSecurityMD ? ejbSecurityMD . getTransportGuarantee ( ) : null ; }


Input: Gets EJB security meta data if associated with EJB endpoint . [CODESPLIT] private EJBSecurityMetaData getEjbSecurityMetaData ( final Endpoint endpoint ) { final String ejbName = endpoint . getShortName ( ) ; final Deployment dep = endpoint . getService ( ) . getDeployment ( ) ; final EJBArchiveMetaData ejbArchiveMD = WSHelper . getOptionalAttachment ( dep , EJBArchiveMetaData . class ) ; final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD . getBeanByEjbName ( ejbName ) : null ; return ejbMD != null ? ejbMD . getSecurityMetaData ( ) : null ; }


Input: Returns security domain value . This method checks domain is the same for every EJB 3 endpoint . [CODESPLIT] private String getDomain ( final String oldSecurityDomain , final String nextSecurityDomain ) { if ( nextSecurityDomain == null ) { return oldSecurityDomain ; } if ( oldSecurityDomain == null ) { return nextSecurityDomain ; } ensureSameDomains ( oldSecurityDomain , nextSecurityDomain ) ; return oldSecurityDomain ; }


Input: This method ensures both passed domains contain the same value . [CODESPLIT] private void ensureSameDomains ( final String oldSecurityDomain , final String newSecurityDomain ) { final boolean domainsDiffer = ! oldSecurityDomain . equals ( newSecurityDomain ) ; if ( domainsDiffer ) throw WSLogger . ROOT_LOGGER . multipleSecurityDomainsDetected ( oldSecurityDomain , newSecurityDomain ) ; }


Input: { [CODESPLIT] public void getResourceValue ( final ResolutionContext resolutionContext , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) { final String applicationName = resolutionContext . getApplicationName ( ) ; final String moduleName = resolutionContext . getModuleName ( ) ; final String componentName = resolutionContext . getComponentName ( ) ; final boolean compUsesModule = resolutionContext . isCompUsesModule ( ) ; final String scheme = org . jboss . as . naming . InitialContext . getURLScheme ( lookupName ) ; if ( scheme == null ) { // relative name, build absolute name and setup normal lookup injection if ( componentName != null && ! compUsesModule ) { ContextNames . bindInfoFor ( applicationName , moduleName , componentName , "java:comp/env/" + lookupName ) . setupLookupInjection ( serviceBuilder , injector , phaseContext . getDeploymentUnit ( ) , optional ) ; } else if ( compUsesModule ) { ContextNames . bindInfoFor ( applicationName , moduleName , componentName , "java:module/env/" + lookupName ) . setupLookupInjection ( serviceBuilder , injector , phaseContext . getDeploymentUnit ( ) , optional ) ; } else { ContextNames . bindInfoFor ( applicationName , moduleName , componentName , "java:jboss/env/" + lookupName ) . setupLookupInjection ( serviceBuilder , injector , phaseContext . getDeploymentUnit ( ) , optional ) ; } } else { if ( scheme . equals ( "java" ) ) { // an absolute java name, setup normal lookup injection if ( compUsesModule && lookupName . startsWith ( "java:comp/" ) ) { // switch "comp" with "module" ContextNames . bindInfoFor ( applicationName , moduleName , componentName , "java:module/" + lookupName . substring ( 10 ) ) . setupLookupInjection ( serviceBuilder , injector , phaseContext . getDeploymentUnit ( ) , optional ) ; } else { ContextNames . bindInfoFor ( applicationName , moduleName , componentName , lookupName ) . setupLookupInjection ( serviceBuilder , injector , phaseContext . getDeploymentUnit ( ) , optional ) ; } } else { // an absolute non java name final ManagedReferenceFactory managedReferenceFactory ; if ( URL_SCHEMES . contains ( scheme ) ) { // a Java EE Standard Resource Manager Connection Factory for URLs, using lookup to define value of URL, inject factory that creates URL instances managedReferenceFactory = new ManagedReferenceFactory ( ) { @ Override public ManagedReference getReference ( ) { try { return new ImmediateManagedReference ( new URL ( lookupName ) ) ; } catch ( MalformedURLException e ) { throw new RuntimeException ( e ) ; } } } ; } else { // lookup for a non java jndi resource, inject factory which does a true jndi lookup managedReferenceFactory = new ManagedReferenceFactory ( ) { @ Override public ManagedReference getReference ( ) { try { return new ImmediateManagedReference ( new InitialContext ( ) . lookup ( lookupName ) ) ; } catch ( NamingException e ) { EeLogger . ROOT_LOGGER . tracef ( e , "failed to lookup %s" , lookupName ) ; return null ; } } } ; } injector . inject ( managedReferenceFactory ) ; } } }


Input: { [CODESPLIT] @ Override public void readElement ( final XMLExtendedStreamReader reader , final List < ModelNode > list ) throws XMLStreamException { // Require no attributes or content requireNoAttributes ( reader ) ; requireNoContent ( reader ) ; list . add ( Util . createAddOperation ( PathAddress . pathAddress ( WeldExtension . PATH_SUBSYSTEM ) ) ) ; }


Input: Set my unqualified IDL name . This also sets the names of the associated operations . [CODESPLIT] void setIDLName ( String idlName ) { super . setIDLName ( idlName ) ; // If the first char is an uppercase letter and the second char is not // an uppercase letter, then convert the first char to lowercase. if ( idlName . charAt ( 0 ) >= 0x41 && idlName . charAt ( 0 ) <= 0x5a && ( idlName . length ( ) <= 1 || idlName . charAt ( 1 ) < 0x41 || idlName . charAt ( 1 ) > 0x5a ) ) { idlName = idlName . substring ( 0 , 1 ) . toLowerCase ( Locale . ENGLISH ) + idlName . substring ( 1 ) ; } if ( accessorAnalysis != null ) accessorAnalysis . setIDLName ( "_get_" + idlName ) ; if ( mutatorAnalysis != null ) mutatorAnalysis . setIDLName ( "_set_" + idlName ) ; }


Input: Get the absolute JNDI name as a string . [CODESPLIT] public String getAbsoluteName ( ) { final StringBuilder absolute = new StringBuilder ( ) ; if ( parent != null ) { absolute . append ( parent ) . append ( ENTRY_SEPARATOR ) ; } absolute . append ( local ) ; return absolute . toString ( ) ; }


Input: Create a new instance of the JndiName by breaking the provided string format into a JndiName parts . [CODESPLIT] public static JndiName of ( final String name ) { if ( name == null || name . isEmpty ( ) ) throw NamingLogger . ROOT_LOGGER . invalidJndiName ( name ) ; final String [ ] parts = name . split ( ENTRY_SEPARATOR ) ; JndiName current = null ; for ( String part : parts ) { current = new JndiName ( current , part ) ; } return current ; }


Input: Process a deployment for iron - jacamar . xml files . Will parse the xml file and attach metadata discovered during processing . [CODESPLIT] @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot resourceRoot = deploymentUnit . getAttachment ( Attachments . DEPLOYMENT_ROOT ) ; final VirtualFile deploymentRoot = resourceRoot . getRoot ( ) ; final boolean resolveProperties = Util . shouldResolveJBoss ( deploymentUnit ) ; IronJacamarXmlDescriptor xmlDescriptor = process ( deploymentRoot , resolveProperties ) ; if ( xmlDescriptor != null ) { deploymentUnit . putAttachment ( IronJacamarXmlDescriptor . ATTACHMENT_KEY , xmlDescriptor ) ; } }


Input: Increments the counter and registers a listener to decrement the counter upon exchange complete event . [CODESPLIT] @ Override public void handleRequest ( HttpServerExchange exchange ) throws Exception { runningCount . increment ( ) ; exchange . addExchangeCompleteListener ( new ExchangeCompletionListener ( ) { @ Override public void exchangeEvent ( HttpServerExchange exchange , NextListener nextListener ) { runningCount . decrement ( ) ; // Proceed to next listener must be called! nextListener . proceed ( ) ; } } ) ; wrappedHandler . handleRequest ( exchange ) ; }


Input: Return the actual JMSContext used by this injection . [CODESPLIT] @ Override JMSContext getDelegate ( ) { boolean inTx = isInTransaction ( ) ; AbstractJMSContext jmsContext = inTx ? transactedJMSContext . get ( ) : requestedJMSContext ; ROOT_LOGGER . debugf ( "using %s to create the injected JMSContext" , jmsContext , id ) ; ConnectionFactory connectionFactory = getConnectionFactory ( ) ; JMSContext contextInstance = jmsContext . getContext ( id , info , connectionFactory ) ; //fix of  WFLY-9501 // CCM tries to clean opened connections before execution of @PreDestroy method on JMSContext - which is executed after completion, see . // Correct phase to call close is afterCompletion {@see TransactionSynchronizationRegistry.registerInterposedSynchronization} if ( inTx ) { TransactedJMSContext transactedJMSContext = ( TransactedJMSContext ) jmsContext ; transactedJMSContext . registerCleanUpListener ( transactionSynchronizationRegistry , contextInstance ) ; } return contextInstance ; }


Input: check whether there is an active transaction . [CODESPLIT] private boolean isInTransaction ( ) { TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry ( ) ; boolean inTx = tsr . getTransactionStatus ( ) == Status . STATUS_ACTIVE ; return inTx ; }


Input: lookup the transactionSynchronizationRegistry and cache it . [CODESPLIT] private TransactionSynchronizationRegistry getTransactionSynchronizationRegistry ( ) { TransactionSynchronizationRegistry cachedTSR = transactionSynchronizationRegistry ; if ( cachedTSR == null ) { cachedTSR = ( TransactionSynchronizationRegistry ) lookup ( TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUP ) ; transactionSynchronizationRegistry = cachedTSR ; } return cachedTSR ; }


Input: lookup the connectionFactory and cache it . [CODESPLIT] private ConnectionFactory getConnectionFactory ( ) { ConnectionFactory cachedCF = connectionFactory ; if ( cachedCF == null ) { cachedCF = ( ConnectionFactory ) lookup ( info . getConnectionFactoryLookup ( ) ) ; connectionFactory = cachedCF ; } return cachedCF ; }


Input: Get the last component of a name . [CODESPLIT] public static String getLastComponent ( final Name name ) { if ( name . size ( ) > 0 ) return name . get ( name . size ( ) - 1 ) ; return "" ; }


Input: Determine if a name is empty or if ot contains only one component which is the empty string . [CODESPLIT] public static boolean isEmpty ( final Name name ) { return name . isEmpty ( ) || ( name . size ( ) == 1 && "" . equals ( name . get ( 0 ) ) ) ; }


Input: Create a name - not - found exception . [CODESPLIT] public static NameNotFoundException nameNotFoundException ( final String name , final Name contextName ) { return NamingLogger . ROOT_LOGGER . nameNotFoundInContext ( name , contextName ) ; }


Input: Return a general naming exception with a root cause . [CODESPLIT] public static NamingException namingException ( final String message , final Throwable cause ) { final NamingException exception = new NamingException ( message ) ; if ( cause != null ) exception . initCause ( cause ) ; return exception ; }


Input: Return a general naming exception with a root cause and a remaining name field . [CODESPLIT] public static NamingException namingException ( final String message , final Throwable cause , final Name remainingName ) { final NamingException exception = namingException ( message , cause ) ; exception . setRemainingName ( remainingName ) ; return exception ; }


Input: Return a cannot - proceed exception . [CODESPLIT] public static CannotProceedException cannotProceedException ( final Object resolvedObject , final Name remainingName ) { final CannotProceedException cpe = new CannotProceedException ( ) ; cpe . setResolvedObj ( resolvedObject ) ; cpe . setRemainingName ( remainingName ) ; return cpe ; }


Input: Return a naming enumeration over a collection . [CODESPLIT] public static < T > NamingEnumeration < T > namingEnumeration ( final Collection < T > collection ) { final Iterator < T > iterator = collection . iterator ( ) ; return new NamingEnumeration < T > ( ) { public T next ( ) { return nextElement ( ) ; } public boolean hasMore ( ) { return hasMoreElements ( ) ; } public void close ( ) { } public boolean hasMoreElements ( ) { return iterator . hasNext ( ) ; } public T nextElement ( ) { return iterator . next ( ) ; } } ; }


Input: Rebind val to name in ctx and make sure that all intermediate contexts exist [CODESPLIT] public static void rebind ( final Context ctx , final String name , final Object value ) throws NamingException { final Name n = ctx . getNameParser ( "" ) . parse ( name ) ; rebind ( ctx , n , value ) ; }


Input: Unbinds a name from ctx and removes parents if they are empty [CODESPLIT] public static void unbind ( Context ctx , String name ) throws NamingException { unbind ( ctx , ctx . getNameParser ( "" ) . parse ( name ) ) ; }


Input: Hook to allow subclasses to handle read - attribute requests for attributes other than { @link CommonAttributes#STARTED } . Implementations must not call any of the { @link org . jboss . as . controller . OperationContext#completeStep ( OperationContext . ResultHandler ) context . completeStep variants } . <p > This default implementation just throws the exception returned by { @link #unsupportedAttribute ( String ) } . < / p > [CODESPLIT] protected void handleReadAttribute ( String attributeName , OperationContext context , ModelNode operation ) throws OperationFailedException { unsupportedAttribute ( attributeName ) ; }


Input: Hook to allow subclasses to handle operations other than { @code read - attribute } { @code start } and { @code stop } . Implementations must not call any of the { @link org . jboss . as . controller . OperationContext#completeStep ( OperationContext . ResultHandler ) context . completeStep variants } . <p > This default implementation just throws the exception returned by { @link #unsupportedOperation ( String ) } . < / p > [CODESPLIT] protected Object handleOperation ( String operationName , OperationContext context , ModelNode operation ) throws OperationFailedException { unsupportedOperation ( operationName ) ; throw MessagingLogger . ROOT_LOGGER . unsupportedOperation ( operationName ) ; }


Input: Gets the runtime ActiveMQ control object that can help service this request . [CODESPLIT] protected final T getActiveMQComponentControl ( final OperationContext context , final ModelNode operation , final boolean forWrite ) throws OperationFailedException { final ServiceName artemisServiceName = MessagingServices . getActiveMQServiceName ( PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) ) ; ServiceController < ? > artemisService = context . getServiceRegistry ( forWrite ) . getService ( artemisServiceName ) ; ActiveMQServer server = ActiveMQServer . class . cast ( artemisService . getValue ( ) ) ; PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; T control = getActiveMQComponentControl ( server , address ) ; if ( control == null ) { throw ControllerLogger . ROOT_LOGGER . managementResourceNotFound ( address ) ; } return control ; }


Input: Parses connection attributes for version 5 . 0 [CODESPLIT] private String parseConnectionAttributes_5_0 ( final XMLExtendedStreamReader reader , final ModelNode connectionDefinitionNode ) throws XMLStreamException { String poolName = null ; String jndiName = null ; int attributeSize = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < attributeSize ; i ++ ) { ConnectionDefinition . Attribute attribute = ConnectionDefinition . Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; String value = reader . getAttributeValue ( i ) ; switch ( attribute ) { case ENABLED : { ENABLED . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case CONNECTABLE : { CONNECTABLE . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case TRACKING : { TRACKING . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case JNDI_NAME : { jndiName = value ; JNDINAME . parseAndSetParameter ( jndiName , connectionDefinitionNode , reader ) ; break ; } case POOL_NAME : { poolName = value ; break ; } case USE_JAVA_CONTEXT : { USE_JAVA_CONTEXT . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case USE_CCM : { USE_CCM . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case SHARABLE : { SHARABLE . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case ENLISTMENT : { ENLISTMENT . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case CLASS_NAME : { CLASS_NAME . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case MCP : { MCP . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case ENLISTMENT_TRACE : ENLISTMENT_TRACE . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; default : throw ParseUtils . unexpectedAttribute ( reader , i ) ; } } if ( poolName == null || poolName . trim ( ) . equals ( "" ) ) { if ( jndiName != null && jndiName . trim ( ) . length ( ) != 0 ) { if ( jndiName . contains ( "/" ) ) { poolName = jndiName . substring ( jndiName . lastIndexOf ( "/" ) + 1 ) ; } else { poolName = jndiName . substring ( jndiName . lastIndexOf ( ":" ) + 1 ) ; } } else { throw ParseUtils . missingRequired ( reader , EnumSet . of ( ConnectionDefinition . Attribute . JNDI_NAME ) ) ; } } return poolName ; }


Input: parse a single connection - definition tag [CODESPLIT] protected void parseConnectionDefinitions_5_0 ( final XMLExtendedStreamReader reader , final Map < String , ModelNode > map , final Map < String , HashMap < String , ModelNode > > configMap , final boolean isXa ) throws XMLStreamException , ParserException , ValidateException { final ModelNode connectionDefinitionNode = new ModelNode ( ) ; connectionDefinitionNode . get ( OP ) . set ( ADD ) ; final String poolName = parseConnectionAttributes_5_0 ( reader , connectionDefinitionNode ) ; boolean poolDefined = Boolean . FALSE ; while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case END_ELEMENT : { if ( Activation . Tag . forName ( reader . getLocalName ( ) ) == Activation . Tag . CONNECTION_DEFINITION ) { map . put ( poolName , connectionDefinitionNode ) ; return ; } else { if ( ConnectionDefinition . Tag . forName ( reader . getLocalName ( ) ) == ConnectionDefinition . Tag . UNKNOWN ) { throw ParseUtils . unexpectedEndElement ( reader ) ; } } break ; } case START_ELEMENT : { switch ( ConnectionDefinition . Tag . forName ( reader . getLocalName ( ) ) ) { case CONFIG_PROPERTY : { if ( ! configMap . containsKey ( poolName ) ) { configMap . put ( poolName , new HashMap < String , ModelNode > ( 0 ) ) ; } parseConfigProperties ( reader , configMap . get ( poolName ) ) ; break ; } case SECURITY : { parseElytronSupportedSecuritySettings ( reader , connectionDefinitionNode ) ; break ; } case TIMEOUT : { parseTimeOut ( reader , isXa , connectionDefinitionNode ) ; break ; } case VALIDATION : { parseValidation ( reader , connectionDefinitionNode ) ; break ; } case XA_POOL : { if ( ! isXa ) { throw ParseUtils . unexpectedElement ( reader ) ; } if ( poolDefined ) { throw new ParserException ( bundle . multiplePools ( ) ) ; } parseXaPool ( reader , connectionDefinitionNode ) ; poolDefined = true ; break ; } case POOL : { if ( isXa ) { throw ParseUtils . unexpectedElement ( reader ) ; } if ( poolDefined ) { throw new ParserException ( bundle . multiplePools ( ) ) ; } parsePool ( reader , connectionDefinitionNode ) ; poolDefined = true ; break ; } case RECOVERY : { parseElytronSupportedRecovery ( reader , connectionDefinitionNode ) ; break ; } default : throw ParseUtils . unexpectedElement ( reader ) ; } break ; } } } throw ParseUtils . unexpectedEndElement ( reader ) ; }


Input: parse a single connection - definition tag [CODESPLIT] protected void parseConnectionDefinitions_1_0 ( final XMLExtendedStreamReader reader , final Map < String , ModelNode > map , final Map < String , HashMap < String , ModelNode > > configMap , final boolean isXa ) throws XMLStreamException , ParserException , ValidateException { final ModelNode connectionDefinitionNode = new ModelNode ( ) ; connectionDefinitionNode . get ( OP ) . set ( ADD ) ; String poolName = null ; String jndiName = null ; int attributeSize = reader . getAttributeCount ( ) ; boolean poolDefined = Boolean . FALSE ; for ( int i = 0 ; i < attributeSize ; i ++ ) { ConnectionDefinition . Attribute attribute = ConnectionDefinition . Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; String value = reader . getAttributeValue ( i ) ; switch ( attribute ) { case ENABLED : { ENABLED . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case JNDI_NAME : { jndiName = value ; JNDINAME . parseAndSetParameter ( jndiName , connectionDefinitionNode , reader ) ; break ; } case POOL_NAME : { poolName = value ; break ; } case USE_JAVA_CONTEXT : { USE_JAVA_CONTEXT . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case USE_CCM : { USE_CCM . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case SHARABLE : { SHARABLE . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case ENLISTMENT : { ENLISTMENT . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } case CLASS_NAME : { CLASS_NAME . parseAndSetParameter ( value , connectionDefinitionNode , reader ) ; break ; } default : throw ParseUtils . unexpectedAttribute ( reader , i ) ; } } if ( poolName == null || poolName . trim ( ) . equals ( "" ) ) { if ( jndiName != null && jndiName . trim ( ) . length ( ) != 0 ) { if ( jndiName . contains ( "/" ) ) { poolName = jndiName . substring ( jndiName . lastIndexOf ( "/" ) + 1 ) ; } else { poolName = jndiName . substring ( jndiName . lastIndexOf ( ":" ) + 1 ) ; } } else { throw ParseUtils . missingRequired ( reader , EnumSet . of ( ConnectionDefinition . Attribute . JNDI_NAME ) ) ; } } while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case END_ELEMENT : { if ( Activation . Tag . forName ( reader . getLocalName ( ) ) == Activation . Tag . CONNECTION_DEFINITION ) { map . put ( poolName , connectionDefinitionNode ) ; return ; } else { if ( ConnectionDefinition . Tag . forName ( reader . getLocalName ( ) ) == ConnectionDefinition . Tag . UNKNOWN ) { throw ParseUtils . unexpectedEndElement ( reader ) ; } } break ; } case START_ELEMENT : { switch ( ConnectionDefinition . Tag . forName ( reader . getLocalName ( ) ) ) { case CONFIG_PROPERTY : { if ( ! configMap . containsKey ( poolName ) ) { configMap . put ( poolName , new HashMap < String , ModelNode > ( 0 ) ) ; } parseConfigProperties ( reader , configMap . get ( poolName ) ) ; break ; } case SECURITY : { parseSecuritySettings ( reader , connectionDefinitionNode ) ; break ; } case TIMEOUT : { parseTimeOut ( reader , isXa , connectionDefinitionNode ) ; break ; } case VALIDATION : { parseValidation ( reader , connectionDefinitionNode ) ; break ; } case XA_POOL : { if ( ! isXa ) { throw ParseUtils . unexpectedElement ( reader ) ; } if ( poolDefined ) { throw new ParserException ( bundle . multiplePools ( ) ) ; } parseXaPool ( reader , connectionDefinitionNode ) ; poolDefined = true ; break ; } case POOL : { if ( isXa ) { throw ParseUtils . unexpectedElement ( reader ) ; } if ( poolDefined ) { throw new ParserException ( bundle . multiplePools ( ) ) ; } parsePool ( reader , connectionDefinitionNode ) ; poolDefined = true ; break ; } case RECOVERY : { parseRecovery ( reader , connectionDefinitionNode ) ; break ; } default : throw ParseUtils . unexpectedElement ( reader ) ; } break ; } } } throw ParseUtils . unexpectedEndElement ( reader ) ; }


Input: parse a { @link XaPool } object [CODESPLIT] protected void parseXaPool ( XMLExtendedStreamReader reader , ModelNode node ) throws XMLStreamException , ParserException , ValidateException { while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case END_ELEMENT : { if ( XaDataSource . Tag . forName ( reader . getLocalName ( ) ) == XaDataSource . Tag . XA_POOL ) { return ; } else { if ( XaPool . Tag . forName ( reader . getLocalName ( ) ) == XaPool . Tag . UNKNOWN ) { throw ParseUtils . unexpectedEndElement ( reader ) ; } } break ; } case START_ELEMENT : { switch ( XaPool . Tag . forName ( reader . getLocalName ( ) ) ) { case MAX_POOL_SIZE : { String value = rawElementText ( reader ) ; MAX_POOL_SIZE . parseAndSetParameter ( value , node , reader ) ; break ; } case MIN_POOL_SIZE : { String value = rawElementText ( reader ) ; MIN_POOL_SIZE . parseAndSetParameter ( value , node , reader ) ; break ; } case INITIAL_POOL_SIZE : { String value = rawElementText ( reader ) ; INITIAL_POOL_SIZE . parseAndSetParameter ( value , node , reader ) ; break ; } case PREFILL : { String value = rawElementText ( reader ) ; POOL_PREFILL . parseAndSetParameter ( value , node , reader ) ; break ; } case FAIR : { String value = rawElementText ( reader ) ; POOL_FAIR . parseAndSetParameter ( value , node , reader ) ; break ; } case USE_STRICT_MIN : { String value = rawElementText ( reader ) ; POOL_USE_STRICT_MIN . parseAndSetParameter ( value , node , reader ) ; break ; } case FLUSH_STRATEGY : { String value = rawElementText ( reader ) ; POOL_FLUSH_STRATEGY . parseAndSetParameter ( value , node , reader ) ; break ; } case INTERLEAVING : { String value = rawElementText ( reader ) ; //just presence means true value = value == null ? "true" : value ; INTERLEAVING . parseAndSetParameter ( value , node , reader ) ; break ; } case IS_SAME_RM_OVERRIDE : { String value = rawElementText ( reader ) ; SAME_RM_OVERRIDE . parseAndSetParameter ( value , node , reader ) ; break ; } case NO_TX_SEPARATE_POOLS : { String value = rawElementText ( reader ) ; //just presence means true value = value == null ? "true" : value ; NOTXSEPARATEPOOL . parseAndSetParameter ( value , node , reader ) ; break ; } case PAD_XID : { String value = rawElementText ( reader ) ; PAD_XID . parseAndSetParameter ( value , node , reader ) ; break ; } case WRAP_XA_RESOURCE : { String value = rawElementText ( reader ) ; WRAP_XA_RESOURCE . parseAndSetParameter ( value , node , reader ) ; break ; } case CAPACITY : { parseCapacity ( reader , node ) ; break ; } default : throw ParseUtils . unexpectedElement ( reader ) ; } break ; } } } throw ParseUtils . unexpectedEndElement ( reader ) ; }


Input: Wraps an existing object instance in a ComponentInstance and run the post construct interceptor chain on it . [CODESPLIT] public ComponentInstance createInstance ( Object instance ) { BasicComponentInstance obj = constructComponentInstance ( new ImmediateManagedReference ( instance ) , true ) ; obj . constructionFinished ( ) ; return obj ; }