signature:
public class AbstractMetaDataBuilderPOJO { /** * Builds universal JSE meta data model that is AS agnostic .
 * @ param dep webservice deployment
 * @ return universal JSE meta data model */
JSEArchiveMetaData create ( final Deployment dep ) { } }

implementation:
if ( WSLogger . ROOT_LOGGER . isTraceEnabled ( ) ) { WSLogger . ROOT_LOGGER . tracef ( "Creating JBoss agnostic meta data for POJO webservice deployment: %s" , dep . getSimpleName ( ) ) ; } final JBossWebMetaData jbossWebMD = WSHelper . getRequiredAttachment ( dep , JBossWebMetaData . class ) ; final DeploymentUnit unit = WSHelper . getRequiredAttachment ( dep , DeploymentUnit . class ) ; final List < POJOEndpoint > pojoEndpoints = getPojoEndpoints ( unit ) ; final JSEArchiveMetaData . Builder builder = new JSEArchiveMetaData . Builder ( ) ; // set context root
final String contextRoot = getContextRoot ( dep , jbossWebMD ) ; builder . setContextRoot ( contextRoot ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting context root: %s" , contextRoot ) ; // set servlet url patterns mappings
final Map < String , String > servletMappings = getServletUrlPatternsMappings ( jbossWebMD , pojoEndpoints ) ; builder . setServletMappings ( servletMappings ) ; // set servlet class names mappings
final Map < String , String > servletClassNamesMappings = getServletClassMappings ( jbossWebMD , pojoEndpoints ) ; builder . setServletClassNames ( servletClassNamesMappings ) ; // set security domain
final String securityDomain = jbossWebMD . getSecurityDomain ( ) ; builder . setSecurityDomain ( securityDomain ) ; // set wsdl location resolver
final JBossWebservicesMetaData jbossWebservicesMD = WSHelper . getOptionalAttachment ( dep , JBossWebservicesMetaData . class ) ; if ( jbossWebservicesMD != null ) { final PublishLocationAdapter resolver = new PublishLocationAdapterImpl ( jbossWebservicesMD . getWebserviceDescriptions ( ) ) ; builder . setPublishLocationAdapter ( resolver ) ; } // set security meta data
final List < JSESecurityMetaData > jseSecurityMDs = getSecurityMetaData ( jbossWebMD . getSecurityConstraints ( ) ) ; builder . setSecurityMetaData ( jseSecurityMDs ) ; // set config name and file
setConfigNameAndFile ( builder , jbossWebMD , jbossWebservicesMD ) ; return builder . build ( ) ;


signature:
public class AbstractMetaDataBuilderPOJO { /** * Sets config name and config file .
 * @ param builder universal JSE meta data model builder
 * @ param jbossWebMD jboss web meta data */
private void setConfigNameAndFile ( final JSEArchiveMetaData . Builder builder , final JBossWebMetaData jbossWebMD , final JBossWebservicesMetaData jbossWebservicesMD ) { } }

implementation:
if ( jbossWebservicesMD != null ) { if ( jbossWebservicesMD . getConfigName ( ) != null ) { final String configName = jbossWebservicesMD . getConfigName ( ) ; builder . setConfigName ( configName ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting config name: %s" , configName ) ; final String configFile = jbossWebservicesMD . getConfigFile ( ) ; builder . setConfigFile ( configFile ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting config file: %s" , configFile ) ; // ensure higher priority against web . xml context parameters
return ; } } final List < ParamValueMetaData > contextParams = jbossWebMD . getContextParams ( ) ; if ( contextParams != null ) { for ( final ParamValueMetaData contextParam : contextParams ) { if ( WSConstants . JBOSSWS_CONFIG_NAME . equals ( contextParam . getParamName ( ) ) ) { final String configName = contextParam . getParamValue ( ) ; builder . setConfigName ( configName ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting config name: %s" , configName ) ; } if ( WSConstants . JBOSSWS_CONFIG_FILE . equals ( contextParam . getParamName ( ) ) ) { final String configFile = contextParam . getParamValue ( ) ; builder . setConfigFile ( configFile ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting config file: %s" , configFile ) ; } } }


signature:
public class AbstractMetaDataBuilderPOJO { /** * Builds security meta data .
 * @ param securityConstraintsMD security constraints meta data
 * @ return universal JSE security meta data model */
private List < JSESecurityMetaData > getSecurityMetaData ( final List < SecurityConstraintMetaData > securityConstraintsMD ) { } }

implementation:
final List < JSESecurityMetaData > jseSecurityMDs = new LinkedList < JSESecurityMetaData > ( ) ; if ( securityConstraintsMD != null ) { for ( final SecurityConstraintMetaData securityConstraintMD : securityConstraintsMD ) { final JSESecurityMetaData . Builder jseSecurityMDBuilder = new JSESecurityMetaData . Builder ( ) ; // transport guarantee
jseSecurityMDBuilder . setTransportGuarantee ( securityConstraintMD . getTransportGuarantee ( ) . name ( ) ) ; // web resources
for ( final WebResourceCollectionMetaData webResourceMD : securityConstraintMD . getResourceCollections ( ) ) { jseSecurityMDBuilder . addWebResource ( webResourceMD . getName ( ) , webResourceMD . getUrlPatterns ( ) ) ; } jseSecurityMDs . add ( jseSecurityMDBuilder . build ( ) ) ; } } return jseSecurityMDs ;


signature:
public class AbstractMetaDataBuilderPOJO { /** * Returns servlet name to url pattern mappings .
 * @ param jbossWebMD jboss web meta data
 * @ return servlet name to url pattern mappings */
private Map < String , String > getServletUrlPatternsMappings ( final JBossWebMetaData jbossWebMD , final List < POJOEndpoint > pojoEndpoints ) { } }

implementation: final Map < String , String > mappings = new HashMap < String , String > ( ) ; final List < ServletMappingMetaData > servletMappings = WebMetaDataHelper . getServletMappings ( jbossWebMD ) ; for ( final POJOEndpoint pojoEndpoint : pojoEndpoints ) { mappings . put ( pojoEndpoint . getName ( ) , pojoEndpoint . getUrlPattern ( ) ) ; if ( ! pojoEndpoint . isDeclared ( ) ) { final String endpointName = pojoEndpoint . getName ( ) ; final List < String > urlPatterns = WebMetaDataHelper . getUrlPatterns ( pojoEndpoint . getUrlPattern ( ) ) ; WebMetaDataHelper . newServletMapping ( endpointName , urlPatterns , servletMappings ) ; } } return mappings ;


signature:
public class AbstractMetaDataBuilderPOJO { /** * Returns servlet name to servlet class mappings .
 * @ param jbossWebMD jboss web meta data
 * @ return servlet name to servlet mappings */
private Map < String , String > getServletClassMappings ( final JBossWebMetaData jbossWebMD , final List < POJOEndpoint > pojoEndpoints ) { } }

implementation: final Map < String , String > mappings = new HashMap < String , String > ( ) ; final JBossServletsMetaData servlets = WebMetaDataHelper . getServlets ( jbossWebMD ) ; for ( final POJOEndpoint pojoEndpoint : pojoEndpoints ) { final String pojoName = pojoEndpoint . getName ( ) ; final String pojoClassName = pojoEndpoint . getClassName ( ) ; mappings . put ( pojoName , pojoClassName ) ; if ( ! pojoEndpoint . isDeclared ( ) ) { final String endpointName = pojoEndpoint . getName ( ) ; final String endpointClassName = pojoEndpoint . getClassName ( ) ; WebMetaDataHelper . newServlet ( endpointName , endpointClassName , servlets ) ; } } return mappings ;


signature:
public class EjbInjectionSource { /** * Checks if this ejb injection has been resolved yet , and if not resolves it . */
private void resolve ( ) { } }

implementation:
if ( ! resolved ) { synchronized ( this ) { if ( ! resolved ) { final Set < ViewDescription > views = getViews ( ) ; final Set < EJBViewDescription > ejbsForViewName = new HashSet < EJBViewDescription > ( ) ; for ( final ViewDescription view : views ) { if ( view instanceof EJBViewDescription ) { final MethodIntf viewType = ( ( EJBViewDescription ) view ) . getMethodIntf ( ) ; // @ EJB injection * shouldn ' t * consider the @ WebService endpoint view or MDBs
if ( viewType == MethodIntf . SERVICE_ENDPOINT || viewType == MethodIntf . MESSAGE_ENDPOINT ) { continue ; } ejbsForViewName . add ( ( EJBViewDescription ) view ) ; } } if ( ejbsForViewName . isEmpty ( ) ) { if ( beanName == null ) { error = EjbLogger . ROOT_LOGGER . ejbNotFound ( typeName , bindingName ) ; } else { error = EjbLogger . ROOT_LOGGER . ejbNotFound ( typeName , beanName , bindingName ) ; } } else if ( ejbsForViewName . size ( ) > 1 ) { if ( beanName == null ) { error = EjbLogger . ROOT_LOGGER . moreThanOneEjbFound ( typeName , bindingName , ejbsForViewName ) ; } else { error = EjbLogger . ROOT_LOGGER . moreThanOneEjbFound ( typeName , beanName , bindingName , ejbsForViewName ) ; } } else { final EJBViewDescription description = ejbsForViewName . iterator ( ) . next ( ) ; final EJBViewDescription ejbViewDescription = ( EJBViewDescription ) description ; // for remote interfaces we do not want to use a normal binding
// we need to bind the remote proxy factory into JNDI instead to get the correct behaviour
if ( ejbViewDescription . getMethodIntf ( ) == MethodIntf . REMOTE || ejbViewDescription . getMethodIntf ( ) == MethodIntf . HOME ) { final EJBComponentDescription componentDescription = ( EJBComponentDescription ) description . getComponentDescription ( ) ; final EEModuleDescription moduleDescription = componentDescription . getModuleDescription ( ) ; final String earApplicationName = moduleDescription . getEarApplicationName ( ) ; final Value < ClassLoader > viewClassLoader = new Value < ClassLoader > ( ) { @ Override public ClassLoader getValue ( ) throws IllegalStateException , IllegalArgumentException { final Module module = deploymentUnit . getAttachment ( Attachments . MODULE ) ; return module != null ? module . getClassLoader ( ) : null ; } } ; remoteFactory = new RemoteViewManagedReferenceFactory ( earApplicationName , moduleDescription . getModuleName ( ) , moduleDescription . getDistinctName ( ) , componentDescription . getComponentName ( ) , description . getViewClassName ( ) , componentDescription . isStateful ( ) , viewClassLoader , appclient ) ; } final ServiceName serviceName = description . getServiceName ( ) ; resolvedViewName = serviceName ; } resolved = true ; } } }


signature:
public class RandomSingletonElectionPolicy { /** * { @ inheritDoc } */
@ Override public Node elect ( List < Node > nodes ) { } }

implementation: int size = nodes . size ( ) ; return ( size > 0 ) ? nodes . get ( this . random . nextInt ( size ) ) : null ;


signature:
public class BroadcastGroupDefinition { /** * FIXME use capabilities & requirements */
private static Set < String > getAvailableConnectors ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { } }

implementation: PathAddress address = PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) ; PathAddress active = MessagingServices . getActiveMQServerPathAddress ( address ) ; Set < String > availableConnectors = new HashSet < String > ( ) ; Resource subsystemResource = context . readResourceFromRoot ( active . getParent ( ) , false ) ; availableConnectors . addAll ( subsystemResource . getChildrenNames ( CommonAttributes . REMOTE_CONNECTOR ) ) ; Resource activeMQServerResource = context . readResourceFromRoot ( active , false ) ; availableConnectors . addAll ( activeMQServerResource . getChildrenNames ( CommonAttributes . HTTP_CONNECTOR ) ) ; availableConnectors . addAll ( activeMQServerResource . getChildrenNames ( CommonAttributes . IN_VM_CONNECTOR ) ) ; availableConnectors . addAll ( activeMQServerResource . getChildrenNames ( CommonAttributes . REMOTE_CONNECTOR ) ) ; availableConnectors . addAll ( activeMQServerResource . getChildrenNames ( CommonAttributes . CONNECTOR ) ) ; return availableConnectors ;


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

implementation: if ( serviceName != null ) { serviceBuilder . requires ( serviceName ) ; } final RemoteViewManagedReferenceFactory factory = new RemoteViewManagedReferenceFactory ( appName , moduleName , distinctName , beanName , viewClass , stateful , viewClassLoader , appclient ) ; injector . inject ( factory ) ;


signature:
public class TransactionSubsystem10Parser { /** * Handle the core - environment element and children
 * @ param reader
 * @ return ModelNode for the core - environment
 * @ throws javax . xml . stream . XMLStreamException */
static void parseCoreEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } }

implementation:
final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case NODE_IDENTIFIER : TransactionSubsystemRootResourceDefinition . NODE_IDENTIFIER . parseAndSetParameter ( value , operation , reader ) ; break ; case PATH : case RELATIVE_TO : throw TransactionLogger . ROOT_LOGGER . unsupportedAttribute ( attribute . getLocalName ( ) , reader . getLocation ( ) ) ; default : throw unexpectedAttribute ( reader , i ) ; } } // elements
final EnumSet < Element > required = EnumSet . of ( Element . PROCESS_ID ) ; final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { final Element element = Element . forName ( reader . getLocalName ( ) ) ; required . remove ( element ) ; switch ( element ) { case PROCESS_ID : { if ( ! encountered . add ( element ) ) { throw duplicateNamedElement ( reader , reader . getLocalName ( ) ) ; } parseProcessIdEnvironmentElement ( reader , operation ) ; break ; } default : throw unexpectedElement ( reader ) ; } } if ( ! required . isEmpty ( ) ) { throw missingRequiredElement ( reader , required ) ; }


signature:
public class TransactionSubsystem10Parser { /** * Handle the process - id child elements
 * @ param reader
 * @ param coreEnvironmentAdd
 * @ return
 * @ throws javax . xml . stream . XMLStreamException */
static void parseProcessIdEnvironmentElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } }

implementation:
// no attributes
if ( reader . getAttributeCount ( ) > 0 ) { throw unexpectedAttribute ( reader , 0 ) ; } // elements
boolean encountered = false ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { final Element element = Element . forName ( reader . getLocalName ( ) ) ; switch ( element ) { case UUID : if ( encountered ) { throw unexpectedElement ( reader ) ; } encountered = true ; if ( reader . getAttributeCount ( ) > 0 ) { throw unexpectedAttribute ( reader , 0 ) ; } coreEnvironmentAdd . get ( TransactionSubsystemRootResourceDefinition . PROCESS_ID_UUID . getName ( ) ) . set ( true ) ; requireNoContent ( reader ) ; break ; case SOCKET : { if ( encountered ) { throw unexpectedElement ( reader ) ; } encountered = true ; parseSocketProcessIdElement ( reader , coreEnvironmentAdd ) ; break ; } default : throw unexpectedElement ( reader ) ; } } if ( ! encountered ) { throw missingOneOf ( reader , EnumSet . of ( Element . UUID , Element . SOCKET ) ) ; }


signature:
public class PhaseOnePersistenceUnitServiceImpl { /** * Create EE container entity manager factory
 * @ return EntityManagerFactory */
private EntityManagerFactoryBuilder createContainerEntityManagerFactoryBuilder ( ) { } }

implementation:
persistenceProviderAdaptor . beforeCreateContainerEntityManagerFactory ( pu ) ; try { TwoPhaseBootstrapCapable twoPhaseBootstrapCapable = ( TwoPhaseBootstrapCapable ) persistenceProviderAdaptor ; return twoPhaseBootstrapCapable . getBootstrap ( pu , properties . getValue ( ) ) ; } finally { try { persistenceProviderAdaptor . afterCreateContainerEntityManagerFactory ( pu ) ; } finally { pu . setAnnotationIndex ( null ) ; // close reference to Annotation Index ( only needed during call to createContainerEntityManagerFactory )
} }


signature:
public class HibernatePersistenceProviderAdaptor { /** * org . hibernate . jpa . event . spi . jpa . ExtendedBeanManager is added to Hibernate 5.1 as an extension for delaying registration
 * of entity listeners until the CDI AfterDeploymentValidation event is triggered .
 * This allows entity listener classes to reference the ( origin ) persistence unit ( WFLY - 2387 ) .
 * return true for Hibernate ORM 5.1 + , which should contain the ExtendedBeanManager contract */
private boolean isHibernateExtendedBeanManagerSupported ( ) { } }

implementation: try { Class . forName ( HIBERNATE_EXTENDED_BEANMANAGER ) ; return true ; } catch ( ClassNotFoundException ignore ) { return false ; } catch ( NoClassDefFoundError ignore ) { return false ; }


signature:
public class Operations { /** * Returns the address of the specified operation
 * @ param operation an operation
 * @ return a path address */
public static PathAddress getPathAddress ( ModelNode operation ) { } }

implementation: return PathAddress . pathAddress ( operation . require ( ModelDescriptionConstants . OP_ADDR ) ) ;


signature:
public class Operations { /** * Sets the address of the specified operation .
 * @ param operation an operation
 * @ param address a path address */
public static void setPathAddress ( ModelNode operation , PathAddress address ) { } }

implementation: operation . get ( ModelDescriptionConstants . OP_ADDR ) . set ( address . toModelNode ( ) ) ;


signature:
public class Operations { /** * Returns the attribute value of the specified operation
 * @ param operation an operation
 * @ return an attribute value */
public static ModelNode getAttributeValue ( ModelNode operation ) { } }

implementation: return operation . hasDefined ( ModelDescriptionConstants . VALUE ) ? operation . get ( ModelDescriptionConstants . VALUE ) : new ModelNode ( ) ;


signature:
public class Operations { /** * Indicates whether or not this operation expects to include default values .
 * @ param operation an operation
 * @ return true , if default values are expected , false otherwise . */
public static boolean isIncludeDefaults ( ModelNode operation ) { } }

implementation: return operation . hasDefined ( ModelDescriptionConstants . INCLUDE_DEFAULTS ) ? operation . get ( ModelDescriptionConstants . INCLUDE_DEFAULTS ) . asBoolean ( ) : true ;


signature:
public class Operations { /** * Creates a composite operation using the specified operation steps .
 * @ param operations steps
 * @ return a composite operation */
public static ModelNode createCompositeOperation ( List < ModelNode > operations ) { } }

implementation: ModelNode operation = Util . createOperation ( ModelDescriptionConstants . COMPOSITE , PathAddress . EMPTY_ADDRESS ) ; ModelNode steps = operation . get ( ModelDescriptionConstants . STEPS ) ; for ( ModelNode step : operations ) { steps . add ( step ) ; } return operation ;


signature:
public class Operations { /** * Creates an add operation using the specified address and parameters
 * @ param address a path address
 * @ param parameters a map of values per attribute
 * @ return an add operation */
public static ModelNode createAddOperation ( PathAddress address , Map < Attribute , ModelNode > parameters ) { } }

implementation: ModelNode operation = Util . createAddOperation ( address ) ; for ( Map . Entry < Attribute , ModelNode > entry : parameters . entrySet ( ) ) { operation . get ( entry . getKey ( ) . getName ( ) ) . set ( entry . getValue ( ) ) ; } return operation ;


signature:
public class Operations { /** * Creates an indexed add operation using the specified address and index
 * @ param address a path address
 * @ param index
 * @ return an add operation */
public static ModelNode createAddOperation ( PathAddress address , int index ) { } }

implementation: return createAddOperation ( address , index , Collections . emptyMap ( ) ) ;


signature:
public class Operations { /** * Creates a read - attribute operation using the specified address and name .
 * @ param address a resource path
 * @ param attribute an attribute
 * @ return a read - attribute operation */
public static ModelNode createReadAttributeOperation ( PathAddress address , Attribute attribute ) { } }

implementation: return createAttributeOperation ( ModelDescriptionConstants . READ_ATTRIBUTE_OPERATION , address , attribute ) ;


signature:
public class Operations { /** * Creates a write - attribute operation using the specified address , name and value .
 * @ param address a resource path
 * @ param attribute an attribute
 * @ param value an attribute value
 * @ return a write - attribute operation */
public static ModelNode createWriteAttributeOperation ( PathAddress address , Attribute attribute , ModelNode value ) { } }

implementation: ModelNode operation = createAttributeOperation ( ModelDescriptionConstants . WRITE_ATTRIBUTE_OPERATION , address , attribute ) ; operation . get ( ModelDescriptionConstants . VALUE ) . set ( value ) ; return operation ;


signature:
public class Operations { /** * Creates an undefine - attribute operation using the specified address and name .
 * @ param address a resource path
 * @ param attribute an attribute
 * @ return an undefine - attribute operation */
public static ModelNode createUndefineAttributeOperation ( PathAddress address , Attribute attribute ) { } }

implementation: return createAttributeOperation ( ModelDescriptionConstants . UNDEFINE_ATTRIBUTE_OPERATION , address , attribute ) ;


signature:
public class NamingLookupValue { /** * Lookup the value from the naming context .
 * @ return the injected value if present , the value retrieved from the context if not .
 * @ throws IllegalStateException The name is not found in the context when called */
public T getValue ( ) throws IllegalStateException { } }

implementation: final Context context = contextValue . getValue ( ) ; try { return ( T ) context . lookup ( contextName ) ; } catch ( NamingException e ) { throw NamingLogger . ROOT_LOGGER . entryNotRegistered ( e , contextName , context ) ; }


signature:
public class InitialContext { /** * Add an ObjectFactory to handle requests for a specific URL scheme .
 * @ param scheme The URL scheme to handle .
 * @ param factory The ObjectFactory that can handle the requests . */
public static synchronized void addUrlContextFactory ( final String scheme , ObjectFactory factory ) { } }

implementation: Map < String , ObjectFactory > factories = new HashMap < String , ObjectFactory > ( urlContextFactories ) ; factories . put ( scheme , factory ) ; urlContextFactories = Collections . unmodifiableMap ( factories ) ;


signature:
public class InitialContext { /** * Remove an ObjectFactory from the map of registered ones . To make sure that not anybody can remove an
 * ObjectFactory both the scheme as well as the actual object factory itself need to be supplied . So you
 * can only remove the factory if you have the factory object .
 * @ param scheme The URL scheme for which the handler is registered .
 * @ param factory The factory object associated with the scheme
 * @ throws IllegalArgumentException if the requested scheme / factory combination is not registered . */
public static synchronized void removeUrlContextFactory ( final String scheme , ObjectFactory factory ) { } }

implementation: Map < String , ObjectFactory > factories = new HashMap < String , ObjectFactory > ( urlContextFactories ) ; ObjectFactory f = factories . get ( scheme ) ; if ( f == factory ) { factories . remove ( scheme ) ; urlContextFactories = Collections . unmodifiableMap ( factories ) ; return ; } else { throw new IllegalArgumentException ( ) ; }


signature:
public class WildFlyProviderResolver { /** * Returns a list with all { @ link ValidationProvider } validation providers .
 * @ return a list with all { @ link ValidationProvider } validation providers */
@ Override public List < ValidationProvider < ? > > getValidationProviders ( ) { } }

implementation:
// first try the TCCL
List < ValidationProvider < ? > > providers = loadProviders ( WildFlySecurityManager . getCurrentContextClassLoaderPrivileged ( ) ) ; if ( providers != null && ! providers . isEmpty ( ) ) { return providers ; } // otherwise use the loader of this class
else { return loadProviders ( WildFlySecurityManager . getClassLoaderPrivileged ( WildFlyProviderResolver . class ) ) ; }


signature:
public class WildFlyProviderResolver { /** * Retrieves the providers from the given loader , using the service loader mechanism .
 * @ param classLoader the class loader to use
 * @ return a list with providers retrieved via the given loader . May be empty but never { @ code null } */
private List < ValidationProvider < ? > > loadProviders ( ClassLoader classLoader ) { } }

implementation:
@ SuppressWarnings ( "rawtypes" ) Iterator < ValidationProvider > providerIterator = ServiceLoader . load ( ValidationProvider . class , classLoader ) . iterator ( ) ; LinkedList < ValidationProvider < ? > > providers = new LinkedList < ValidationProvider < ? > > ( ) ; while ( providerIterator . hasNext ( ) ) { try { ValidationProvider < ? > provider = providerIterator . next ( ) ; // put Hibernate Validator to the beginning of the list
if ( provider . getClass ( ) . getName ( ) . equals ( "org.hibernate.validator.HibernateValidator" ) ) { providers . addFirst ( provider ) ; } else { providers . add ( provider ) ; } } catch ( ServiceConfigurationError e ) { // ignore , because it can happen when multiple
// providers are present and some of them are not class loader
// compatible with our API .
} } return providers ;


signature:
public class JaccService { /** * { @ inheritDoc } */
@ Override public void start ( StartContext context ) throws StartException { } }

implementation:
try { PolicyConfigurationFactory pcf = getPolicyConfigurationFactory ( ) ; synchronized ( pcf ) { // synchronize on the factory
policyConfiguration = pcf . getPolicyConfiguration ( contextId , false ) ; if ( metaData != null ) { createPermissions ( metaData , policyConfiguration ) ; } else { SecurityLogger . ROOT_LOGGER . debugf ( "Cannot create permissions with 'null' metaData for id=%s" , contextId ) ; } if ( ! standalone ) { PolicyConfiguration parent = parentPolicy . getValue ( ) ; if ( parent != null ) { parent = pcf . getPolicyConfiguration ( parent . getContextID ( ) , false ) ; parent . linkConfiguration ( policyConfiguration ) ; policyConfiguration . commit ( ) ; parent . commit ( ) ; } else { SecurityLogger . ROOT_LOGGER . debugf ( "Could not retrieve parent policy for policy %s" , contextId ) ; } } else { policyConfiguration . commit ( ) ; } // Allow the policy to incorporate the policy configs
Policy . getPolicy ( ) . refresh ( ) ; } } catch ( Exception e ) { throw SecurityLogger . ROOT_LOGGER . unableToStartException ( "JaccService" , e ) ; }


signature:
public class JaccService { /** * { @ inheritDoc } */
@ Override public void stop ( StopContext context ) { } }

implementation:
try { PolicyConfigurationFactory pcf = PolicyConfigurationFactory . getPolicyConfigurationFactory ( ) ; synchronized ( pcf ) { // synchronize on the factory
policyConfiguration = pcf . getPolicyConfiguration ( contextId , false ) ; policyConfiguration . delete ( ) ; } } catch ( Exception e ) { SecurityLogger . ROOT_LOGGER . errorDeletingJACCPolicy ( e ) ; } policyConfiguration = null ;


signature:
public class JACCAuthorizationManager { /** * Gets the canonical request URI - that is , the request URI minus the context path .
 * @ param request the { @ link HttpServletRequest } for which we want the canonical URI .
 * @ return the constructed canonical URI . */
private String getCanonicalURI ( HttpServletRequest request ) { } }

implementation: String canonicalURI = request . getRequestURI ( ) . substring ( request . getContextPath ( ) . length ( ) ) ; if ( canonicalURI == null || canonicalURI . equals ( "/" ) ) canonicalURI = "" ; return canonicalURI ;


signature:
public class ResourceReferenceProcessor { /** * TODO : should this be part of the messaging subsystem */
private List < BindingConfiguration > getMessageDestinationRefs ( final DeploymentDescriptorEnvironment environment , final ClassLoader classLoader , final DeploymentReflectionIndex deploymentReflectionIndex , final ResourceInjectionTarget resourceInjectionTarget , final DeploymentUnit deploymentUnit ) throws DeploymentUnitProcessingException { } }

implementation:
final List < BindingConfiguration > bindings = new ArrayList < BindingConfiguration > ( ) ; final MessageDestinationReferencesMetaData messageDestinationReferences = environment . getEnvironment ( ) . getMessageDestinationReferences ( ) ; if ( messageDestinationReferences == null ) { return bindings ; } for ( final MessageDestinationReferenceMetaData messageRef : messageDestinationReferences ) { if ( messageRef . isDependencyIgnored ( ) ) { continue ; } final String name ; if ( messageRef . getName ( ) . startsWith ( "java:" ) ) { name = messageRef . getName ( ) ; } else { name = environment . getDefaultContext ( ) + messageRef . getName ( ) ; } Class < ? > classType = null ; if ( messageRef . getType ( ) != null ) { try { classType = classLoader . loadClass ( messageRef . getType ( ) ) ; } catch ( ClassNotFoundException e ) { throw EeLogger . ROOT_LOGGER . cannotLoad ( e , messageRef . getType ( ) ) ; } } // our injection ( source ) comes from the local ( ENC ) lookup , no matter what .
final LookupInjectionSource injectionSource = new LookupInjectionSource ( name ) ; classType = processInjectionTargets ( resourceInjectionTarget , injectionSource , classLoader , deploymentReflectionIndex , messageRef , classType ) ; final BindingConfiguration bindingConfiguration ; if ( ! isEmpty ( messageRef . getLookupName ( ) ) ) { bindingConfiguration = new BindingConfiguration ( name , new LookupInjectionSource ( messageRef . getLookupName ( ) ) ) ; bindings . add ( bindingConfiguration ) ; } else if ( ! isEmpty ( messageRef . getMappedName ( ) ) ) { bindingConfiguration = new BindingConfiguration ( name , new LookupInjectionSource ( messageRef . getMappedName ( ) ) ) ; bindings . add ( bindingConfiguration ) ; } else if ( ! isEmpty ( messageRef . getLink ( ) ) ) { final MessageDestinationInjectionSource messageDestinationInjectionSource = new MessageDestinationInjectionSource ( messageRef . getLink ( ) , name ) ; bindingConfiguration = new BindingConfiguration ( name , messageDestinationInjectionSource ) ; deploymentUnit . addToAttachmentList ( Attachments . MESSAGE_DESTINATIONS , messageDestinationInjectionSource ) ; bindings . add ( bindingConfiguration ) ; } else { ROOT_LOGGER . cannotResolve ( "message-destination-ref" , name ) ; } } return bindings ;


signature:
public class WebMetaDataModifier { /** * Modifies web meta data to configure webservice stack transport and properties .
 * @ param dep webservice deployment */
void modify ( final Deployment dep ) { } }

implementation: final JBossWebMetaData jbossWebMD = WSHelper . getOptionalAttachment ( dep , JBossWebMetaData . class ) ; if ( jbossWebMD != null ) { this . configureEndpoints ( dep , jbossWebMD ) ; this . modifyContextRoot ( dep , jbossWebMD ) ; }


signature:
public class WebMetaDataModifier { /** * Configures transport servlet class for every found webservice endpoint .
 * @ param dep webservice deployment
 * @ param jbossWebMD web meta data */
private void configureEndpoints ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation:
final String transportClassName = this . getTransportClassName ( dep ) ; WSLogger . ROOT_LOGGER . trace ( "Modifying servlets" ) ; // get a list of the endpoint bean class names
final Set < String > epNames = new HashSet < String > ( ) ; for ( Endpoint ep : dep . getService ( ) . getEndpoints ( ) ) { epNames . add ( ep . getTargetBeanName ( ) ) ; } // fix servlet class names for endpoints
for ( final ServletMetaData servletMD : jbossWebMD . getServlets ( ) ) { final String endpointClassName = ASHelper . getEndpointClassName ( servletMD ) ; if ( endpointClassName != null && endpointClassName . length ( ) > 0 ) { // exclude JSP
if ( epNames . contains ( endpointClassName ) ) { // set transport servlet
servletMD . setServletClass ( WSFServlet . class . getName ( ) ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting transport class: %s for endpoint: %s" , transportClassName , endpointClassName ) ; final List < ParamValueMetaData > initParams = WebMetaDataHelper . getServletInitParams ( servletMD ) ; // configure transport class name
WebMetaDataHelper . newParamValue ( WSFServlet . STACK_SERVLET_DELEGATE_CLASS , transportClassName , initParams ) ; // configure webservice endpoint
WebMetaDataHelper . newParamValue ( Endpoint . SEPID_DOMAIN_ENDPOINT , endpointClassName , initParams ) ; } else if ( endpointClassName . startsWith ( "org.apache.cxf" ) ) { throw WSLogger . ROOT_LOGGER . invalidWSServlet ( endpointClassName ) ; } } }


signature:
public class WebMetaDataModifier { /** * Modifies context root .
 * @ param dep webservice deployment
 * @ param jbossWebMD web meta data */
private void modifyContextRoot ( final Deployment dep , final JBossWebMetaData jbossWebMD ) { } }

implementation: final String contextRoot = dep . getService ( ) . getContextRoot ( ) ; if ( WSLogger . ROOT_LOGGER . isTraceEnabled ( ) ) { WSLogger . ROOT_LOGGER . tracef ( "Setting context root: %s for deployment: %s" , contextRoot , dep . getSimpleName ( ) ) ; } jbossWebMD . setContextRoot ( contextRoot ) ;


signature:
public class WebMetaDataModifier { /** * Returns stack specific transport class name .
 * @ param dep webservice deployment
 * @ return stack specific transport class name
 * @ throws IllegalStateException if transport class name is not found in deployment properties map */
private String getTransportClassName ( final Deployment dep ) { } }

implementation: String transportClassName = ( String ) dep . getProperty ( WSConstants . STACK_TRANSPORT_CLASS ) ; if ( transportClassName == null ) throw WSLogger . ROOT_LOGGER . missingDeploymentProperty ( WSConstants . STACK_TRANSPORT_CLASS ) ; return transportClassName ;


signature:
public class SimpleMarshalledValue { /** * { @ inheritDoc }
 * @ see org . wildfly . clustering . marshalling . spi . MarshalledValue # get ( java . lang . Object ) */
@ SuppressWarnings ( "unchecked" ) @ Override public synchronized T get ( MarshallingContext context ) throws IOException , ClassNotFoundException { } }

implementation:
if ( this . object == null ) { this . context = context ; if ( this . bytes != null ) { ByteArrayInputStream input = new ByteArrayInputStream ( this . bytes ) ; ClassLoader loader = setThreadContextClassLoader ( this . context . getClassLoader ( ) ) ; try ( SimpleDataInput data = new SimpleDataInput ( Marshalling . createByteInput ( input ) ) ) { int version = IndexSerializer . VARIABLE . readInt ( data ) ; try ( Unmarshaller unmarshaller = context . createUnmarshaller ( version ) ) { unmarshaller . start ( data ) ; this . object = ( T ) unmarshaller . readObject ( ) ; unmarshaller . finish ( ) ; this . bytes = null ; // Free up memory
} } finally { setThreadContextClassLoader ( loader ) ; } } } return this . object ;


signature:
public class CalendarUtil { /** * Returns the last date of the month represented by the passed < code > cal < / code >
 * @ param calendar The { @ link java . util . Calendar } whose { @ link java . util . Calendar # MONTH } field will be used
 * as the current month
 * @ return */
public static int getLastDateOfMonth ( Calendar calendar ) { } }

implementation: Calendar tmpCal = new GregorianCalendar ( calendar . getTimeZone ( ) ) ; tmpCal . set ( Calendar . YEAR , calendar . get ( Calendar . YEAR ) ) ; tmpCal . set ( Calendar . MONTH , calendar . get ( Calendar . MONTH ) ) ; tmpCal . set ( Calendar . DAY_OF_MONTH , 1 ) ; return tmpCal . getActualMaximum ( Calendar . DAY_OF_MONTH ) ;


signature:
public class MessageDrivenComponentCreateService { /** * 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 .
 * @ param resourceAdapterName The resource adapter name
 * @ param activation { @ link Activation }
 * @ param activationConfigProps Activation config properties which will be checked for validity
 * @ return */
private Properties filterUnknownActivationConfigProperties ( final String resourceAdapterName , final Activation activation , final Properties activationConfigProps ) { } }

implementation:
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 ;


signature:
public class MessageDrivenComponentCreateService { /** * Returns the { @ link org . jboss . jca . core . spi . rar . Endpoint } corresponding to the passed < code > resourceAdapterName < / code >
 * @ param resourceAdapterName The resource adapter name
 * @ return */
private Endpoint getEndpoint ( final String resourceAdapterName ) { } }

implementation:
// 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 ) ; }


signature:
public class SecurityActions { /** * Create a JBoss Security Context with the given security domain name
 * @ param domain the security domain name ( such as " other " )
 * @ return an instanceof { @ code SecurityContext } */
static SecurityContext createSecurityContext ( final String domain ) { } }

implementation: 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 ) ; } }


signature:
public class SecurityActions { /** * Set the { @ code SecurityContext } on the { @ code SecurityContextAssociation }
 * @ param sc the security context */
static void setSecurityContextOnAssociation ( final SecurityContext sc ) { } }

implementation: if ( WildFlySecurityManager . isChecking ( ) ) { WildFlySecurityManager . doUnchecked ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { SecurityContextAssociation . setSecurityContext ( sc ) ; return null ; } } ) ; } else { SecurityContextAssociation . setSecurityContext ( sc ) ; }


signature:
public class SecurityActions { /** * Get the current { @ code SecurityContext }
 * @ return an instance of { @ code SecurityContext } */
static SecurityContext getSecurityContext ( ) { } }

implementation: if ( WildFlySecurityManager . isChecking ( ) ) { return WildFlySecurityManager . doUnchecked ( new PrivilegedAction < SecurityContext > ( ) { public SecurityContext run ( ) { return SecurityContextAssociation . getSecurityContext ( ) ; } } ) ; } else { return SecurityContextAssociation . getSecurityContext ( ) ; }


signature:
public class SecurityActions { /** * Clears current { @ code SecurityContext } */
static void clearSecurityContext ( ) { } }

implementation: if ( WildFlySecurityManager . isChecking ( ) ) { WildFlySecurityManager . doUnchecked ( new PrivilegedAction < Void > ( ) { public Void run ( ) { SecurityContextAssociation . clearSecurityContext ( ) ; return null ; } } ) ; } else { SecurityContextAssociation . clearSecurityContext ( ) ; }


signature:
public class SecurityActions { /** * Sets the run as identity
 * @ param principal the identity */
static RunAs setRunAsIdentity ( final RunAs principal , final SecurityContext sc ) { } }

implementation: 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 ; }


signature:
public class SecurityActions { /** * Removes the run as identity
 * @ return the identity removed */
static RunAs popRunAsIdentity ( final SecurityContext sc ) { } }

implementation: 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 ; }


signature:
public class UndertowDeploymentProcessor { /** * todo move to UndertowDeploymentService and use all registered servlets from Deployment instead of just one found by metadata */
void processManagement ( final DeploymentUnit unit , JBossWebMetaData metaData ) { } }

implementation:
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 ; } }


signature:
public class UndertowDeploymentProcessor { /** * Try to obtain the security domain configured in jboss - app . xml at the ear level if available */
private String getJBossAppSecurityDomain ( final DeploymentUnit deploymentUnit ) { } }

implementation: 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 ;


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

implementation: 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 ) ;


signature:
public class BinderServiceUtil { /** * Install a binder service to bind the { @ code obj } using the binding { @ code name } .
 * @ param serviceTarget
 * @ param name the binding name
 * @ param obj the object that must be bound */
public static void installBinderService ( final ServiceTarget serviceTarget , final String name , final Object obj ) { } }

implementation: 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 ( ) ;


signature:
public class BinderServiceUtil { /** * Install a binder service to bind the value of the { @ code service } using the binding { @ code name } .
 * @ param serviceTarget
 * @ param name the binding name
 * @ param service the service whose value must be bound */
public static void installBinderService ( final ServiceTarget serviceTarget , final String name , final Service < ? > service , final ServiceName dependency ) { } }

implementation:
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 ( ) ;


signature:
public class EJB3SubsystemRootResourceDefinition { /** * Overrides the default impl to use a special definition of the add op that includes additional parameter
 * { @ link # DEFAULT _ CLUSTERED _ SFSB _ CACHE }
 * { @ inheritDoc } */
@ Override protected void registerAddOperation ( ManagementResourceRegistration registration , AbstractAddStepHandler handler , OperationEntry . Flag ... flags ) { } }

implementation: OperationDefinition od = new SimpleOperationDefinitionBuilder ( ADD , getResourceDescriptionResolver ( ) ) . setParameters ( ATTRIBUTES ) . addParameter ( DEFAULT_CLUSTERED_SFSB_CACHE ) . withFlags ( flags ) . build ( ) ; registration . registerOperationHandler ( od , handler ) ;


signature:
public class Injection { /** * Inject a value into an object property
 * @ param object The object
 * @ param propertyName The property name
 * @ param propertyValue The property value
 * @ throws NoSuchMethodException If the property method cannot be found
 * @ throws IllegalAccessException If the property method cannot be accessed
 * @ throws InvocationTargetException If the property method cannot be executed */
@ SuppressWarnings ( "unchecked" ) public void inject ( Object object , String propertyName , Object propertyValue ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { } }

implementation: inject ( object , propertyName , propertyValue , null , false ) ;


signature:
public class Injection { /** * Compare the type of a class with the actual value
 * @ param classType The class type
 * @ param propertyType The property type
 * @ return True if they match , or if there is a primitive mapping */
private boolean argumentMatches ( String classType , String propertyType ) { } }

implementation: 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" ) ) ;


signature:
public class Injection { /** * Find a method
 * @ param clz The class
 * @ param methodName The method name
 * @ param propertyType The property type ; can be < code > null < / code >
 * @ return The method ; < code > null < / code > if not found */
protected Method findMethod ( Class < ? > clz , String methodName , String propertyType ) { } }

implementation: 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 ;


signature:
public class Injection { /** * Find a field
 * @ param clz The class
 * @ param fieldName The field name
 * @ param fieldType The field type ; can be < code > null < / code >
 * @ return The field ; < code > null < / code > if not found */
protected Field findField ( Class < ? > clz , String fieldName , String fieldType ) { } }

implementation: 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 ;


signature:
public class ManagedReferenceLifecycleMethodInterceptor { /** * { @ inheritDoc } */
public Object processInvocation ( final InterceptorContext context ) throws Exception { } }

implementation:
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 ( ) ) ; }


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

implementation: final 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 ) ; } }


signature:
public class Name { /** * escape any occurrence of " / " , " . " and " \ " */
private static String escape ( String s ) { } }

implementation: 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 ( ) ;


signature:
public class VaultTool { /** * Build options for non - interactive VaultTool usage scenario .
 * @ return */
private void initOptions ( ) { } }

implementation: 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 ) ;


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

implementation: 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 ) ;


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

implementation: 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 ) ;


signature:
public class AuditNotificationReceiver { /** * Obtain debug information from the servlet request object
 * @ param httpRequest
 * @ return */
private static String deriveUsefulInfo ( HttpServletRequest httpRequest ) { } }

implementation:
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 ( ) ;


signature:
public class UndertowEngine { /** * { @ inheritDoc }
 * @ return overridden session cookie name if defined , otherwise { @ link io . undertow . server . session . SessionCookieConfig # DEFAULT _ SESSION _ ID } */
@ Override public String getSessionCookieName ( ) { } }

implementation: SessionCookieConfig override = server . getServletContainer ( ) . getSessionCookieConfig ( ) ; if ( override == null || override . getName ( ) == null ) { return io . undertow . server . session . SessionCookieConfig . DEFAULT_SESSION_ID ; } return override . getName ( ) ;


signature:
public class JdrReportService { /** * Collect a JDR report when run outside the Application Server .
 * @ param cli */
public JdrReport standaloneCollect ( CLI cli , String protocol , String host , int port ) throws OperationFailedException { } }

implementation: return new JdrRunner ( cli , protocol , host , port , null , null ) . collect ( ) ;


signature:
public class JdrReportService { /** * Collect a JDR report . */
public JdrReport collect ( ) throws OperationFailedException { } }

implementation: 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 ( ) ;


signature:
public class ResourceAdapterDeploymentRegistryImpl { /** * Register a resource adapter deployment
 * @ param deployment The deployment */
public void registerResourceAdapterDeployment ( ResourceAdapterDeployment deployment ) { } }

implementation: if ( deployment == null ) throw new IllegalArgumentException ( ConnectorLogger . ROOT_LOGGER . nullVar ( "Deployment" ) ) ; DEPLOYMENT_CONNECTOR_REGISTRY_LOGGER . tracef ( "Adding deployment: %s" , deployment ) ; deployments . add ( deployment ) ;


signature:
public class ResourceAdapterDeploymentRegistryImpl { /** * Unregister a resource adapter deployment
 * @ param deployment The deployment */
public void unregisterResourceAdapterDeployment ( ResourceAdapterDeployment deployment ) { } }

implementation: if ( deployment == null ) throw new IllegalArgumentException ( ConnectorLogger . ROOT_LOGGER . nullVar ( "Deployment" ) ) ; DEPLOYMENT_CONNECTOR_REGISTRY_LOGGER . tracef ( "Removing deployment: %s" , deployment ) ; deployments . remove ( deployment ) ;


signature:
public class UndertowSubsystemAdd { /** * { @ inheritDoc } */
@ Override protected void performBoottime ( OperationContext context , ModelNode operation , Resource resource ) throws OperationFailedException { } }

implementation:
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 ( ) ;


signature:
public class JASPICSecurityContext { /** * 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 .
 * @ param username The username
 * @ param password The password
 * @ return < code > true < / code > if the login succeeded , false otherwise
 * @ throws SecurityException if login is called when JASPIC is enabled for application context and layer . */
@ Override public boolean login ( final String username , final String password ) { } }

implementation:
// 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 ) ;


signature:
public class JASPICSecurityContext { /** * JASPIC 1.1 specification : if there is an { @ code AuthConfigProvider } for the { @ code HttpServlet } layer and
 * application context , then @ { @ code logout } must acquire a { @ code ServerAuthContext } and call { @ code cleanSubject }
 * on the acquired context .
 * The specified { @ code Subject } should be non - null and should be the { @ code Subject } returning from the most recent
 * call to { @ code validateRequest } . In our case , that { @ code Subject } is set in the underlying security context , so
 * we must retrieve it from there before calling { @ code cleanSubject } .
 * Once { @ code cleanSubject } returns , { @ code logout } must perform the regular ( non - JASPIC ) { @ code logout } processing . */
@ Override public void logout ( ) { } }

implementation:
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 ( ) ;


signature:
public class JASPICSecurityContext { /** * 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 } .
 * @ return the authenticated account ( or cached account when it is null ) . */
@ Override public Account getAuthenticatedAccount ( ) { } }

implementation: Account account = super . getAuthenticatedAccount ( ) ; if ( account == null ) account = this . cachedAuthenticatedAccount ; return account ;


signature:
public class JASPICSecurityContext { /** * Builds the JASPIC application context .
 * @ return a { @ code String } representing the application context . */
private String buildAppContext ( ) { } }

implementation: final ServletRequestContext requestContext = exchange . getAttachment ( ServletRequestContext . ATTACHMENT_KEY ) ; ServletRequest servletRequest = requestContext . getServletRequest ( ) ; return servletRequest . getServletContext ( ) . getVirtualServerName ( ) + " " + servletRequest . getServletContext ( ) . getContextPath ( ) ;


signature:
public class JASPICSecurityContext { /** * Builds the { @ code MessageInfo } instance for the { @ code cleanSubject ( ) } call .
 * @ return the constructed { @ code MessageInfo } object . */
private MessageInfo buildMessageInfo ( ) { } }

implementation:
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 ;


signature:
public class JASPICSecurityContext { /** * Retrieves the authenticated subject from the underlying security context .
 * @ return a reference to the authenticated subject . */
private Subject getAuthenticatedSubject ( ) { } }

implementation: 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 ( ) ;


signature:
public class AttributeParsers { /** * Reads a { @ code name } attribute on an element .
 * @ param reader the reader used to read the attribute with
 * @ return the name attribute or { @ code null } if the name attribute was not defined
 * @ throws XMLStreamException if an XML processing error occurs */
static String readNameAttribute ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } }

implementation: return readRequiredAttributes ( reader , EnumSet . of ( Attribute . NAME ) ) . get ( Attribute . NAME ) ;


signature:
public class AttributeParsers { /** * Reads a { @ code value } attribute on an element .
 * @ param reader the reader used to read the attribute with
 * @ return the value attribute or { @ code null } if the value attribute was not defined
 * @ throws XMLStreamException if an XML processing error occurs */
static String readValueAttribute ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } }

implementation: return readRequiredAttributes ( reader , EnumSet . of ( Attribute . VALUE ) ) . get ( Attribute . VALUE ) ;


signature:
public class AttributeParsers { /** * Reads the required attributes from an XML configuration .
 * The reader must be on an element with attributes .
 * @ param reader the reader for the attributes
 * @ param attributes the required attributes
 * @ return a map of the required attributes with the key being the attribute and the value being the value of the
 * attribute
 * @ throws XMLStreamException if an XML processing error occurs */
static Map < Attribute , String > readRequiredAttributes ( final XMLExtendedStreamReader reader , final Set < Attribute > attributes ) throws XMLStreamException { } }

implementation: 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 ;


signature:
public class JPADependencyProcessor { /** * Add dependencies for modules required for JPA deployments */
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation:
final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( Attachments . MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; // 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 ) ;


signature:
public class JPADependencyProcessor { /** * Add the < code > puServiceName < / code > as a dependency on each of the passed < code > components < / code >
 * @ param components The components to which the PU service is added as a dependency
 * @ param holder The persistence units */
private static void addPUServiceDependencyToComponents ( final Collection < ComponentDescription > components , final PersistenceUnitMetadataHolder holder ) { } }

implementation: 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 ) ; } } }


signature:
public class JacORBExtension { /** * Register the transformers for the 1.3.0 version .
 * @ param subsystem the subsystems registration */
protected static void registerTransformers ( final SubsystemRegistration subsystem ) { } }

implementation:
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 } ) ;


signature:
public class StubStrategy { /** * 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 " .
 * @ param paramTypes a string array with marshaller abbreviated names for
 * the method parameters
 * @ param excepIds a string array with the CORBA repository ids of the
 * exceptions thrown by the method
 * @ param excepTypes a string array with the Java class names of the
 * exceptions thrown by the method
 * @ param retvalType marshaller abbreaviated name for the return value of
 * the method
 * @ param cl a < code > ClassLoader < / code > to load value classes
 * ( if null , the current thread ' s context class loader
 * will be used )
 * @ return an < code > StubStrategy < / code > for the operation with the
 * parameters , exceptions , and return value specified .
 * @ see org . wildfly . iiop . openjdk . rmi . marshal . CDRStream # abbrevFor ( Class clz ) */
public static StubStrategy forMethod ( String [ ] paramTypes , String [ ] excepIds , String [ ] excepTypes , String retvalType , ClassLoader cl ) { } }

implementation:
// 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 ) ;


signature:
public class StubStrategy { /** * Marshals the sequence of method parameters into an output stream .
 * @ param out a CDR output stream
 * @ param params an object array with the parameters . */
public void writeParams ( OutputStream out , Object [ ] params ) { } }

implementation: 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 ) ) ; }


signature:
public class StubStrategy { /** * Unmarshals from an input stream an exception thrown by the method .
 * @ param id the repository id of the exception to unmarshal
 * @ param in a CDR input stream
 * @ return an exception unmarshaled from the stream . */
public Exception readException ( String id , InputStream in ) { } }

implementation: ExceptionReader exceptionReader = ( ExceptionReader ) exceptionMap . get ( id ) ; if ( exceptionReader == null ) { return new UnexpectedException ( id ) ; } else { return exceptionReader . read ( in ) ; }


signature:
public class StubStrategy { /** * Checks if a given < code > Throwable < / code > instance corresponds to an
 * exception declared by this < code > StubStrategy < / code > ' s method .
 * @ param t an exception class
 * @ return true if < code > t < / code > is an instance of any of the
 * exceptions declared by this < code > StubStrategy < / code > ' s
 * method , false otherwise . */
public boolean isDeclaredException ( Throwable t ) { } }

implementation: Iterator < Class < ? > > iterator = exceptionList . iterator ( ) ; while ( iterator . hasNext ( ) ) { if ( ( ( Class < ? > ) iterator . next ( ) ) . isInstance ( t ) ) { return true ; } } return false ;


signature:
public class StubStrategy { /** * 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 ) .
 * @ param obj the return value to be converted
 * @ return the converted value . */
public Object convertLocalRetval ( Object obj ) { } }

implementation: if ( retvalRemoteInterface == null ) return obj ; else return PortableRemoteObject . narrow ( obj , retvalRemoteInterface ) ;


signature:
public class QueueService { /** * { @ inheritDoc } */
@ Override public synchronized void start ( StartContext context ) throws StartException { } }

implementation: 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 ) ; } }


signature:
public class QueueService { /** * { @ inheritDoc } */
@ Override public synchronized void stop ( StopContext context ) { } }

implementation: 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 ( ) ) ; }


signature:
public class ViewInterfaces { /** * Returns all interfaces implemented by a bean that are eligible to be view interfaces
 * @ param beanClass The bean class
 * @ return A collection of all potential view interfaces */
static Set < Class < ? > > getPotentialViewInterfaces ( Class < ? > beanClass ) { } }

implementation:
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 ;


signature:
public class ViewInterfaces { /** * Returns all interfaces implemented by a bean that are eligible to be view interfaces
 * @ param beanClass The bean class
 * @ return A collection of all potential view interfaces */
static Set < DotName > getPotentialViewInterfaces ( ClassInfo beanClass ) { } }

implementation:
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 ;


signature:
public class TransactionUtil { /** * Save the specified EntityManager in the local threads active transaction . The TransactionSynchronizationRegistry
 * will clear the reference to the EntityManager when the transaction completes .
 * @ param scopedPuName
 * @ param entityManager */
public static void putEntityManagerInTransactionRegistry ( String scopedPuName , EntityManager entityManager , TransactionSynchronizationRegistry tsr ) { } }

implementation: tsr . putResource ( scopedPuName , entityManager ) ;


signature:
public class MessagingXMLWriter { /** * TODO use a custom attribute marshaller */
private static void writeFilter ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } }

implementation: if ( node . hasDefined ( CommonAttributes . FILTER . getName ( ) ) ) { writer . writeEmptyElement ( CommonAttributes . FILTER . getXmlName ( ) ) ; writer . writeAttribute ( CommonAttributes . STRING , node . get ( CommonAttributes . FILTER . getName ( ) ) . asString ( ) ) ; }


signature:
public class WarMetaDataProcessor { /** * Generate the Jar processing order .
 * @ param webOrderings The list of orderings , as parsed from the fragments
 * @ param order The generated order list */
protected static void resolveOrder ( List < WebOrdering > webOrderings , List < String > order ) { } }

implementation:
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 ( ) ) ; }


signature:
public class SecurityDomainContextImpl { /** * Create a JBoss Security Context with the given security domain name
 * @ param domain the security domain name ( such as " other " )
 * @ return an instanceof { @ code SecurityContext } */
private static SecurityContext createSecurityContext ( final String domain ) { } }

implementation: return AccessController . doPrivileged ( new PrivilegedAction < SecurityContext > ( ) { @ Override public SecurityContext run ( ) { try { return SecurityContextFactory . createSecurityContext ( domain ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } } ) ;


signature:
public class SecurityDomainContextImpl { /** * Set the { @ code SecurityContext } on the { @ code SecurityContextAssociation }
 * @ param sc the security context */
private static void setSecurityContextOnAssociation ( final SecurityContext sc ) { } }

implementation: AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { SecurityContextAssociation . setSecurityContext ( sc ) ; return null ; } } ) ;


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

implementation: context . startSubsystemElement ( org . jboss . as . jdr . Namespace . CURRENT . getUriString ( ) , false ) ; writer . writeEndElement ( ) ;


signature:
public class CallAS7 { /** * adds a key / value parameter pair to the call
 * @ param key
 * @ param val
 * @ return this */
public CallAS7 param ( String key , String val ) { } }

implementation: this . parameters . put ( key , val ) ; return this ;


signature:
public class CallAS7 { /** * 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 >
 * @ param parts to call
 * @ return this */
public CallAS7 resource ( String ... parts ) { } }

implementation: for ( String part : parts ) { this . resource . add ( part ) ; } return this ;