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

implementation: if ( WSLogger . ROOT_LOGGER . isTraceEnabled ( ) ) { WSLogger . ROOT_LOGGER . tracef ( "Building JBoss agnostic meta data for EJB webservice deployment: %s" , dep . getSimpleName ( ) ) ; } final EJBArchiveMetaData . Builder ejbArchiveMDBuilder = new EJBArchiveMetaData . Builder ( ) ; this . buildEnterpriseBeansMetaData ( dep , ejbArchiveMDBuilder ) ; this . buildWebservicesMetaData ( dep , ejbArchiveMDBuilder ) ; return ejbArchiveMDBuilder . build ( ) ;


signature:
public class AbstractMetaDataBuilderEJB { /** * Builds webservices meta data . This methods sets :
 * < ul >
 * < li > context root < / li >
 * < li > wsdl location resolver < / li >
 * < li > config name < / li >
 * < li > config file < / li >
 * < / ul >
 * @ param dep webservice deployment
 * @ param ejbArchiveMD universal EJB meta data model */
private void buildWebservicesMetaData ( final Deployment dep , final EJBArchiveMetaData . Builder ejbArchiveMDBuilder ) { } }

implementation:
final JBossWebservicesMetaData webservicesMD = WSHelper . getOptionalAttachment ( dep , JBossWebservicesMetaData . class ) ; if ( webservicesMD == null ) return ; // set context root
final String contextRoot = webservicesMD . getContextRoot ( ) ; ejbArchiveMDBuilder . setWebServiceContextRoot ( contextRoot ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting context root: %s" , contextRoot ) ; // set config name
final String configName = webservicesMD . getConfigName ( ) ; ejbArchiveMDBuilder . setConfigName ( configName ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting config name: %s" , configName ) ; // set config file
final String configFile = webservicesMD . getConfigFile ( ) ; ejbArchiveMDBuilder . setConfigFile ( configFile ) ; WSLogger . ROOT_LOGGER . tracef ( "Setting config file: %s" , configFile ) ; // set wsdl location resolver
final JBossWebserviceDescriptionMetaData [ ] wsDescriptionsMD = webservicesMD . getWebserviceDescriptions ( ) ; final PublishLocationAdapter resolver = new PublishLocationAdapterImpl ( wsDescriptionsMD ) ; ejbArchiveMDBuilder . setPublishLocationAdapter ( resolver ) ;


signature:
public class AbstractMetaDataBuilderEJB { /** * Builds JBoss agnostic EJB meta data .
 * @ param wsEjbsMD
 * jboss agnostic EJBs meta data */
protected void buildEnterpriseBeanMetaData ( final List < EJBMetaData > wsEjbsMD , final EJBEndpoint ejbEndpoint , final JBossWebservicesMetaData jbossWebservicesMD ) { } }

implementation:
final SLSBMetaData . Builder wsEjbMDBuilder = new SLSBMetaData . Builder ( ) ; // set EJB name and class
wsEjbMDBuilder . setEjbName ( ejbEndpoint . getName ( ) ) ; wsEjbMDBuilder . setEjbClass ( ejbEndpoint . getClassName ( ) ) ; final JBossPortComponentMetaData portComponentMD = getPortComponent ( ejbEndpoint . getName ( ) , jbossWebservicesMD ) ; if ( portComponentMD != null ) { // set port component meta data
wsEjbMDBuilder . setPortComponentName ( portComponentMD . getPortComponentName ( ) ) ; wsEjbMDBuilder . setPortComponentURI ( portComponentMD . getPortComponentURI ( ) ) ; } // set security meta data
// auth method
final String authMethod = getAuthMethod ( ejbEndpoint , portComponentMD ) ; // transport guarantee
final String transportGuarantee = getTransportGuarantee ( ejbEndpoint , portComponentMD ) ; // secure wsdl access
final boolean secureWsdlAccess = isSecureWsdlAccess ( ejbEndpoint , portComponentMD ) ; final String realmName = getRealmName ( ejbEndpoint , portComponentMD ) ; // propagate
wsEjbMDBuilder . setSecurityMetaData ( new EJBSecurityMetaData ( authMethod , realmName , transportGuarantee , secureWsdlAccess ) ) ; wsEjbsMD . add ( wsEjbMDBuilder . build ( ) ) ;


signature:
public class AddressSettingsValidator { /** * Validate that an updated address - settings still has resources bound corresponding
 * to expiry - address and dead - letter - address ( if they are defined ) . */
static void validateModel ( OperationContext context , ModelNode operation , Resource resource ) throws OperationFailedException { } }

implementation: String addressSetting = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; PathAddress address = pathAddress ( operation . require ( ModelDescriptionConstants . OP_ADDR ) ) ; Resource activeMQServer = context . readResourceFromRoot ( MessagingServices . getActiveMQServerPathAddress ( address ) , true ) ; checkExpiryAddress ( context , resource . getModel ( ) , activeMQServer , addressSetting ) ; checkDeadLetterAddress ( context , resource . getModel ( ) , activeMQServer , addressSetting ) ;


signature:
public class LogStoreParticipantRecoveryHandler { /** * refresh the attributes of this participant ( the status attribute should have changed to PREPARED */
void refreshParticipant ( OperationContext context ) { } }

implementation: context . addStep ( refreshHandler , OperationContext . Stage . MODEL , true ) ;


signature:
public class EarApplicationNameProcessor { /** * Returns the application name for the passed deployment . If the passed deployment isn ' t an . ear or doesn ' t belong
 * to a . ear , then this method returns null . Else it returns the application - name set in the application . xml of the . ear
 * or if that ' s not set , will return the . ear deployment unit name ( stripped off the . ear suffix ) .
 * @ param deploymentUnit The deployment unit */
private String getApplicationName ( DeploymentUnit deploymentUnit ) { } }

implementation:
final DeploymentUnit parentDU = deploymentUnit . getParent ( ) ; if ( parentDU == null ) { final EarMetaData earMetaData = deploymentUnit . getAttachment ( org . jboss . as . ee . structure . Attachments . EAR_METADATA ) ; if ( earMetaData != null ) { final String overriddenAppName = earMetaData . getApplicationName ( ) ; if ( overriddenAppName == null ) { return this . getEarName ( deploymentUnit ) ; } return overriddenAppName ; } else { return this . getEarName ( deploymentUnit ) ; } } // traverse to top level DU
return this . getApplicationName ( parentDU ) ;


signature:
public class EarApplicationNameProcessor { /** * Returns the name ( stripped off the . ear suffix ) of the passed < code > deploymentUnit < / code > .
 * Returns null if the passed < code > deploymentUnit < / code > ' s name doesn ' t end with . ear suffix .
 * @ param deploymentUnit Deployment unit
 * @ return */
private String getEarName ( final DeploymentUnit deploymentUnit ) { } }

implementation: final String duName = deploymentUnit . getName ( ) ; if ( duName . endsWith ( ".ear" ) ) { return duName . substring ( 0 , duName . length ( ) - ".ear" . length ( ) ) ; } return null ;


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

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


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

implementation: String defined_in_id = "IR" ; if ( defined_in instanceof ContainedOperations ) defined_in_id = ( ( ContainedOperations ) defined_in ) . id ( ) ; ExceptionDescription ed = new ExceptionDescription ( name , id , defined_in_id , version , type ( ) ) ; Any any = getORB ( ) . create_any ( ) ; ExceptionDescriptionHelper . insert ( any , ed ) ; return new Description ( DefinitionKind . dk_Exception , any ) ;


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

implementation:
PathAddress address = PathAddress . pathAddress ( SUBSYSTEM_PATH ) ; final ModelNode ejb3SubsystemAddOperation = Util . createAddOperation ( address ) ; operations . add ( ejb3SubsystemAddOperation ) ; // elements
final EnumSet < NamingSubsystemXMLElement > encountered = EnumSet . noneOf ( NamingSubsystemXMLElement . class ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != XMLStreamConstants . END_ELEMENT ) { if ( validNamespace == NamingSubsystemNamespace . forUri ( reader . getNamespaceURI ( ) ) ) { final NamingSubsystemXMLElement element = NamingSubsystemXMLElement . forName ( reader . getLocalName ( ) ) ; if ( ! encountered . add ( element ) ) { throw unexpectedElement ( reader ) ; } switch ( element ) { case BINDINGS : { parseBindings ( reader , operations , address ) ; break ; } case REMOTE_NAMING : { parseRemoteNaming ( reader , operations , address ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } } else { throw unexpectedElement ( reader ) ; } }


signature:
public class NamingSubsystem14Parser { /** * Parses the optional { @ code ObjectFactory environment } .
 * @ param reader the { @ code XMLExtendedStreamReader } used to read the configuration XML .
 * @ param bindingAdd where to add
 * @ throws javax . xml . stream . XMLStreamException
 * if an error occurs while parsing the XML . */
private void parseObjectFactoryBindingEnvironment ( XMLExtendedStreamReader reader , ModelNode bindingAdd ) throws XMLStreamException { } }

implementation:
// no attributes expected
requireNoAttributes ( reader ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != XMLStreamConstants . END_ELEMENT ) { switch ( NamingSubsystemXMLElement . forName ( reader . getLocalName ( ) ) ) { case ENVIRONMENT_PROPERTY : { final String [ ] array = requireAttributes ( reader , org . jboss . as . controller . parsing . Attribute . NAME . getLocalName ( ) , org . jboss . as . controller . parsing . Attribute . VALUE . getLocalName ( ) ) ; NamingBindingResourceDefinition . ENVIRONMENT . parseAndAddParameterElement ( array [ 0 ] , array [ 1 ] , bindingAdd , reader ) ; requireNoContent ( reader ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } }


signature:
public class SegmentsAndVirtualNodeConverter { /** * Helper methods */
public static String virtualNodesToSegments ( String virtualNodesValue ) { } }

implementation:
int segments = SEGMENTS_DEFAULT ; try { segments = virtualNodesToSegments ( Integer . parseInt ( virtualNodesValue ) ) ; } catch ( NumberFormatException nfe ) { // in case of expression
} return Integer . toString ( segments ) ;


signature:
public class BMTInterceptor { /** * Checks if the passed exception is an application exception . If yes , then throws back the
 * exception as - is . Else , wraps the exception in a { @ link javax . ejb . EJBException } and throws the EJBException
 * @ param ex The exception to handle
 * @ throws Exception Either the passed exception or an EJBException */
protected Exception handleException ( final InterceptorContext invocation , Throwable ex ) throws Exception { } }

implementation:
ApplicationExceptionDetails ae = component . getApplicationException ( ex . getClass ( ) , invocation . getMethod ( ) ) ; // it ' s an application exception , so just throw it back as - is
if ( ae != null ) { throw ( Exception ) ex ; } if ( ex instanceof EJBException ) { throw ( EJBException ) ex ; } else if ( ex instanceof Exception ) { throw new EJBException ( ( Exception ) ex ) ; } else { throw new EJBException ( new RuntimeException ( ex ) ) ; }


signature:
public class IIOPJndiBindingProcessor { /** * Binds java : comp / ORB
 * @ param serviceTarget The service target
 * @ param contextServiceName The service name of the context to bind to */
private void bindService ( final ServiceTarget serviceTarget , final ServiceName contextServiceName , final Module module ) { } }

implementation: final ServiceName orbServiceName = contextServiceName . append ( "ORB" ) ; final BinderService orbService = new BinderService ( "ORB" ) ; serviceTarget . addService ( orbServiceName , orbService ) . addDependency ( CorbaORBService . SERVICE_NAME , ORB . class , new ManagedReferenceInjector < ORB > ( orbService . getManagedObjectInjector ( ) ) ) . addDependency ( contextServiceName , ServiceBasedNamingStore . class , orbService . getNamingStoreInjector ( ) ) . install ( ) ; final ServiceName handleDelegateServiceName = contextServiceName . append ( "HandleDelegate" ) ; final BinderService handleDelegateBindingService = new BinderService ( "HandleDelegate" ) ; handleDelegateBindingService . getManagedObjectInjector ( ) . inject ( new ValueManagedReferenceFactory ( new ImmediateValue ( new HandleDelegateImpl ( module . getClassLoader ( ) ) ) ) ) ; serviceTarget . addService ( handleDelegateServiceName , handleDelegateBindingService ) . addDependency ( contextServiceName , ServiceBasedNamingStore . class , handleDelegateBindingService . getNamingStoreInjector ( ) ) . install ( ) ;


signature:
public class WorkCacheManager { /** * Returns an analysis .
 * If the calling thread is currently doing an analysis of this
 * class , an unfinished analysis is returned . */
ContainerAnalysis getAnalysis ( final Class cls ) throws RMIIIOPViolationException { } }

implementation:
ContainerAnalysis ret = null ; boolean created = false ; try { synchronized ( this ) { ret = lookupDone ( cls ) ; if ( ret != null ) { return ret ; } // is it work - in - progress ?
final ContainerAnalysis inProgress = workInProgress . get ( new InProgressKey ( cls , Thread . currentThread ( ) ) ) ; if ( inProgress != null ) { return inProgress ; // return unfinished
// Do not wait for the other thread : We may deadlock
// Double work is better that deadlock . . .
} ret = createWorkInProgress ( cls ) ; } created = true ; // Do the work
doTheWork ( cls , ret ) ; } finally { // We did it
synchronized ( this ) { if ( created ) { workInProgress . remove ( new InProgressKey ( cls , Thread . currentThread ( ) ) ) ; workDone . put ( cls , new SoftReference < ContainerAnalysis > ( ret ) ) ; ClassLoader classLoader = cls . getClassLoader ( ) ; if ( classLoader != null ) { Set < Class < ? > > classes = classesByLoader . get ( classLoader ) ; if ( classes == null ) { classesByLoader . put ( classLoader , classes = new HashSet < Class < ? > > ( ) ) ; } classes . add ( cls ) ; } } notifyAll ( ) ; } } return ret ;


signature:
public class WorkCacheManager { /** * Lookup an analysis in the fully done map . */
private ContainerAnalysis lookupDone ( Class cls ) { } }

implementation:
SoftReference ref = ( SoftReference ) workDone . get ( cls ) ; if ( ref == null ) return null ; ContainerAnalysis ret = ( ContainerAnalysis ) ref . get ( ) ; if ( ret == null ) workDone . remove ( cls ) ; // clear map entry if soft ref . was cleared .
return ret ;


signature:
public class WorkCacheManager { /** * Create new work - in - progress . */
private ContainerAnalysis createWorkInProgress ( final Class cls ) { } }

implementation: final ContainerAnalysis analysis ; try { analysis = ( ContainerAnalysis ) constructor . newInstance ( cls ) ; } catch ( InstantiationException ex ) { throw new RuntimeException ( ex . toString ( ) ) ; } catch ( IllegalAccessException ex ) { throw new RuntimeException ( ex . toString ( ) ) ; } catch ( InvocationTargetException ex ) { throw new RuntimeException ( ex . toString ( ) ) ; } workInProgress . put ( new InProgressKey ( cls , Thread . currentThread ( ) ) , analysis ) ; return analysis ;


signature:
public class ContainerAnalysis { /** * Return the fully qualified IDL module name that this
 * analysis should be placed in . */
public String getIDLModuleName ( ) { } }

implementation: if ( idlModuleName == null ) { String pkgName = cls . getPackage ( ) . getName ( ) ; StringBuffer b = new StringBuffer ( ) ; while ( ! "" . equals ( pkgName ) ) { int idx = pkgName . indexOf ( '.' ) ; String n = ( idx == - 1 ) ? pkgName : pkgName . substring ( 0 , idx ) ; b . append ( "::" ) . append ( Util . javaToIDLName ( n ) ) ; pkgName = ( idx == - 1 ) ? "" : pkgName . substring ( idx + 1 ) ; } idlModuleName = b . toString ( ) ; } return idlModuleName ;


signature:
public class ContainerAnalysis { /** * Convert an integer to a 16 - digit hex string . */
protected String toHexString ( int i ) { } }

implementation: String s = Integer . toHexString ( i ) . toUpperCase ( Locale . ENGLISH ) ; if ( s . length ( ) < 8 ) return "00000000" . substring ( 0 , 8 - s . length ( ) ) + s ; else return s ;


signature:
public class ContainerAnalysis { /** * Convert a long to a 16 - digit hex string . */
protected String toHexString ( long l ) { } }

implementation: String s = Long . toHexString ( l ) . toUpperCase ( Locale . ENGLISH ) ; if ( s . length ( ) < 16 ) return "0000000000000000" . substring ( 0 , 16 - s . length ( ) ) + s ; else return s ;


signature:
public class ContainerAnalysis { /** * Check if a method is an accessor . */
protected boolean isAccessor ( Method m ) { } }

implementation:
Class returnType = m . getReturnType ( ) ; // JBAS - 4473 , look for get < name > ( )
String name = m . getName ( ) ; if ( ! ( name . startsWith ( "get" ) && name . length ( ) > "get" . length ( ) ) ) if ( ! ( name . startsWith ( "is" ) && name . length ( ) > "is" . length ( ) ) || ! ( returnType == Boolean . TYPE ) ) return false ; if ( returnType == Void . TYPE ) return false ; if ( m . getParameterTypes ( ) . length != 0 ) return false ; return hasNonAppExceptions ( m ) ;


signature:
public class ContainerAnalysis { /** * Check if a method is a mutator . */
protected boolean isMutator ( Method m ) { } }

implementation:
// JBAS - 4473 , look for set < name > ( )
String name = m . getName ( ) ; if ( ! ( name . startsWith ( "set" ) && name . length ( ) > "set" . length ( ) ) ) return false ; if ( m . getReturnType ( ) != Void . TYPE ) return false ; if ( m . getParameterTypes ( ) . length != 1 ) return false ; return hasNonAppExceptions ( m ) ;


signature:
public class ContainerAnalysis { /** * Check if a method throws anything checked other than
 * java . rmi . RemoteException and its subclasses . */
protected boolean hasNonAppExceptions ( Method m ) { } }

implementation: Class [ ] ex = m . getExceptionTypes ( ) ; for ( int i = 0 ; i < ex . length ; ++ i ) if ( ! java . rmi . RemoteException . class . isAssignableFrom ( ex [ i ] ) ) return false ; return true ;


signature:
public class ContainerAnalysis { /** * Analyze the fields of the class .
 * This will fill in the < code > fields < / code > and < code > f _ flags < / code >
 * arrays . */
protected void analyzeFields ( ) { } }

implementation:
// fields = cls . getFields ( ) ;
fields = cls . getDeclaredFields ( ) ; f_flags = new byte [ fields . length ] ; for ( int i = 0 ; i < fields . length ; ++ i ) { int mods = fields [ i ] . getModifiers ( ) ; if ( Modifier . isFinal ( mods ) && Modifier . isStatic ( mods ) && Modifier . isPublic ( mods ) ) f_flags [ i ] |= F_CONSTANT ; }


signature:
public class ContainerAnalysis { /** * Analyze the interfaces of the class .
 * This will fill in the < code > interfaces < / code > array . */
protected void analyzeInterfaces ( ) throws RMIIIOPViolationException { } }

implementation:
Class [ ] intfs = cls . getInterfaces ( ) ; ArrayList a = new ArrayList ( ) ; ArrayList b = new ArrayList ( ) ; for ( int i = 0 ; i < intfs . length ; ++ i ) { // Ignore java . rmi . Remote
if ( intfs [ i ] == java . rmi . Remote . class ) continue ; // Ignore java . io . Serializable
if ( intfs [ i ] == java . io . Serializable . class ) continue ; // Ignore java . io . Externalizable
if ( intfs [ i ] == java . io . Externalizable . class ) continue ; if ( ! RmiIdlUtil . isAbstractValueType ( intfs [ i ] ) ) { a . add ( InterfaceAnalysis . getInterfaceAnalysis ( intfs [ i ] ) ) ; } else { b . add ( ValueAnalysis . getValueAnalysis ( intfs [ i ] ) ) ; } } interfaces = new InterfaceAnalysis [ a . size ( ) ] ; interfaces = ( InterfaceAnalysis [ ] ) a . toArray ( interfaces ) ; abstractBaseValuetypes = new ValueAnalysis [ b . size ( ) ] ; abstractBaseValuetypes = ( ValueAnalysis [ ] ) b . toArray ( abstractBaseValuetypes ) ;


signature:
public class ContainerAnalysis { /** * Analyze the methods of the class .
 * This will fill in the < code > methods < / code > and < code > m _ flags < / code >
 * arrays . */
protected void analyzeMethods ( ) { } }

implementation:
// The dynamic stub and skeleton strategy generation mechanism
// requires the inclusion of inherited methods in the analysis of
// remote interfaces . To speed things up , inherited methods are
// not considered in the analysis of a class or non - remote interface .
if ( cls . isInterface ( ) && java . rmi . Remote . class . isAssignableFrom ( cls ) ) methods = cls . getMethods ( ) ; else methods = cls . getDeclaredMethods ( ) ; m_flags = new byte [ methods . length ] ; mutators = new int [ methods . length ] ; // Find read - write properties
for ( int i = 0 ; i < methods . length ; ++ i ) mutators [ i ] = - 1 ; // no mutator here
for ( int i = 0 ; i < methods . length ; ++ i ) { if ( isAccessor ( methods [ i ] ) && ( m_flags [ i ] & M_READ ) == 0 ) { String attrName = attributeReadName ( methods [ i ] . getName ( ) ) ; Class iReturn = methods [ i ] . getReturnType ( ) ; for ( int j = i + 1 ; j < methods . length ; ++ j ) { if ( isMutator ( methods [ j ] ) && ( m_flags [ j ] & M_WRITE ) == 0 && attrName . equals ( attributeWriteName ( methods [ j ] . getName ( ) ) ) ) { Class [ ] jParams = methods [ j ] . getParameterTypes ( ) ; if ( jParams . length == 1 && jParams [ 0 ] == iReturn ) { m_flags [ i ] |= M_READ ; m_flags [ j ] |= M_WRITE ; mutators [ i ] = j ; break ; } } } } else if ( isMutator ( methods [ i ] ) && ( m_flags [ i ] & M_WRITE ) == 0 ) { String attrName = attributeWriteName ( methods [ i ] . getName ( ) ) ; Class [ ] iParams = methods [ i ] . getParameterTypes ( ) ; for ( int j = i + 1 ; j < methods . length ; ++ j ) { if ( isAccessor ( methods [ j ] ) && ( m_flags [ j ] & M_READ ) == 0 && attrName . equals ( attributeReadName ( methods [ j ] . getName ( ) ) ) ) { Class jReturn = methods [ j ] . getReturnType ( ) ; if ( iParams . length == 1 && iParams [ 0 ] == jReturn ) { m_flags [ i ] |= M_WRITE ; m_flags [ j ] |= M_READ ; mutators [ j ] = i ; break ; } } } } } // Find read - only properties
for ( int i = 0 ; i < methods . length ; ++ i ) if ( ( m_flags [ i ] & ( M_READ | M_WRITE ) ) == 0 && isAccessor ( methods [ i ] ) ) m_flags [ i ] |= M_READONLY ; // Check for overloaded and inherited methods
for ( int i = 0 ; i < methods . length ; ++ i ) { if ( ( m_flags [ i ] & ( M_READ | M_WRITE | M_READONLY ) ) == 0 ) { String iName = methods [ i ] . getName ( ) ; for ( int j = i + 1 ; j < methods . length ; ++ j ) { if ( iName . equals ( methods [ j ] . getName ( ) ) ) { m_flags [ i ] |= M_OVERLOADED ; m_flags [ j ] |= M_OVERLOADED ; } } } if ( methods [ i ] . getDeclaringClass ( ) != cls ) m_flags [ i ] |= M_INHERITED ; }


signature:
public class ContainerAnalysis { /** * Convert an attribute read method name in Java format to
 * an attribute name in Java format . */
protected String attributeReadName ( String name ) { } }

implementation: if ( name . startsWith ( "get" ) ) name = name . substring ( 3 ) ; else if ( name . startsWith ( "is" ) ) name = name . substring ( 2 ) ; else throw IIOPLogger . ROOT_LOGGER . notAnAccessor ( name ) ; return name ;


signature:
public class ContainerAnalysis { /** * Convert an attribute write method name in Java format to
 * an attribute name in Java format . */
protected String attributeWriteName ( String name ) { } }

implementation: if ( name . startsWith ( "set" ) ) name = name . substring ( 3 ) ; else throw IIOPLogger . ROOT_LOGGER . notAnAccessor ( name ) ; return name ;


signature:
public class ContainerAnalysis { /** * Analyse constants .
 * This will fill in the < code > constants < / code > array . */
protected void analyzeConstants ( ) throws RMIIIOPViolationException { } }

implementation:
ArrayList a = new ArrayList ( ) ; for ( int i = 0 ; i < fields . length ; ++ i ) { if ( ( f_flags [ i ] & F_CONSTANT ) == 0 ) continue ; Class type = fields [ i ] . getType ( ) ; // Only map primitives and java . lang . String
if ( ! type . isPrimitive ( ) && type != java . lang . String . class ) { // It is an RMI / IIOP violation for interfaces .
if ( cls . isInterface ( ) ) throw IIOPLogger . ROOT_LOGGER . badRMIIIOPConstantType ( fields [ i ] . getName ( ) , cls . getName ( ) , "1.2.3" ) ; continue ; } String name = fields [ i ] . getName ( ) ; Object value ; try { value = fields [ i ] . get ( null ) ; } catch ( Exception ex ) { throw new RuntimeException ( ex . toString ( ) ) ; } a . add ( new ConstantAnalysis ( name , type , value ) ) ; } constants = new ConstantAnalysis [ a . size ( ) ] ; constants = ( ConstantAnalysis [ ] ) a . toArray ( constants ) ;


signature:
public class ContainerAnalysis { /** * Analyse attributes .
 * This will fill in the < code > attributes < / code > array . */
protected void analyzeAttributes ( ) throws RMIIIOPViolationException { } }

implementation:
ArrayList a = new ArrayList ( ) ; for ( int i = 0 ; i < methods . length ; ++ i ) { // if ( ( m _ flags [ i ] & M _ INHERITED ) ! = 0)
// continue ;
if ( ( m_flags [ i ] & ( M_READ | M_READONLY ) ) != 0 ) { // Read method of an attribute .
String name = attributeReadName ( methods [ i ] . getName ( ) ) ; if ( ( m_flags [ i ] & M_READONLY ) != 0 ) a . add ( new AttributeAnalysis ( name , methods [ i ] ) ) ; else a . add ( new AttributeAnalysis ( name , methods [ i ] , methods [ mutators [ i ] ] ) ) ; } } attributes = new AttributeAnalysis [ a . size ( ) ] ; attributes = ( AttributeAnalysis [ ] ) a . toArray ( attributes ) ;


signature:
public class ContainerAnalysis { /** * Fixup overloaded operation names .
 * As specified in section 1.3.2.6. */
protected void fixupOverloadedOperationNames ( ) throws RMIIIOPViolationException { } }

implementation:
for ( int i = 0 ; i < methods . length ; ++ i ) { if ( ( m_flags [ i ] & M_OVERLOADED ) == 0 ) continue ; // Find the operation
OperationAnalysis oa = null ; String javaName = methods [ i ] . getName ( ) ; for ( int opIdx = 0 ; oa == null && opIdx < operations . length ; ++ opIdx ) if ( operations [ opIdx ] . getMethod ( ) . equals ( methods [ i ] ) ) oa = operations [ opIdx ] ; if ( oa == null ) continue ; // This method is not mapped .
// Calculate new IDL name
ParameterAnalysis [ ] params = oa . getParameters ( ) ; StringBuffer b = new StringBuffer ( oa . getIDLName ( ) ) ; if ( params . length == 0 ) b . append ( "__" ) ; for ( int j = 0 ; j < params . length ; ++ j ) { String s = params [ j ] . getTypeIDLName ( ) ; if ( s . startsWith ( "::" ) ) s = s . substring ( 2 ) ; if ( s . startsWith ( "_" ) ) { // remove leading underscore in IDL escaped identifier
s = s . substring ( 1 ) ; } b . append ( '_' ) ; while ( ! "" . equals ( s ) ) { int idx = s . indexOf ( "::" ) ; b . append ( '_' ) ; if ( idx == - 1 ) { b . append ( s ) ; s = "" ; } else { b . append ( s . substring ( 0 , idx ) ) ; if ( s . length ( ) > idx + 2 && s . charAt ( idx + 2 ) == '_' ) { // remove leading underscore in IDL escaped identifier
s = s . substring ( idx + 3 ) ; } else { s = s . substring ( idx + 2 ) ; } } } } // Set new IDL name
oa . setIDLName ( b . toString ( ) ) ; }


signature:
public class ContainerAnalysis { /** * Fixup names differing only in case .
 * As specified in section 1.3.2.7. */
protected void fixupCaseNames ( ) throws RMIIIOPViolationException { } }

implementation: ArrayList entries = getContainedEntries ( ) ; boolean [ ] clash = new boolean [ entries . size ( ) ] ; String [ ] upperNames = new String [ entries . size ( ) ] ; for ( int i = 0 ; i < entries . size ( ) ; ++ i ) { AbstractAnalysis aa = ( AbstractAnalysis ) entries . get ( i ) ; clash [ i ] = false ; upperNames [ i ] = aa . getIDLName ( ) . toUpperCase ( Locale . ENGLISH ) ; for ( int j = 0 ; j < i ; ++ j ) { if ( upperNames [ i ] . equals ( upperNames [ j ] ) ) { clash [ i ] = true ; clash [ j ] = true ; } } } for ( int i = 0 ; i < entries . size ( ) ; ++ i ) { if ( ! clash [ i ] ) continue ; AbstractAnalysis aa = ( AbstractAnalysis ) entries . get ( i ) ; boolean noUpper = true ; String name = aa . getIDLName ( ) ; StringBuffer b = new StringBuffer ( name ) ; b . append ( '_' ) ; for ( int j = 0 ; j < name . length ( ) ; ++ j ) { if ( ! Character . isUpperCase ( name . charAt ( j ) ) ) continue ; if ( noUpper ) noUpper = false ; else b . append ( '_' ) ; b . append ( j ) ; } aa . setIDLName ( b . toString ( ) ) ; }


signature:
public class ContainerAnalysis { /** * Return the class hash code , as specified in " The Common Object
 * Request Broker : Architecture and Specification " ( 01-02-33 ) ,
 * section 10.6.2. */
protected void calculateClassHashCode ( ) { } }

implementation:
// The simple cases
if ( cls . isInterface ( ) ) classHashCode = 0 ; else if ( ! Serializable . class . isAssignableFrom ( cls ) ) classHashCode = 0 ; else if ( Externalizable . class . isAssignableFrom ( cls ) ) classHashCode = 1 ; else // Go ask Util class for the hash code
classHashCode = Util . getClassHashCode ( cls ) ;


signature:
public class ContainerAnalysis { /** * Escape non - ISO characters for an IR name . */
protected String escapeIRName ( String name ) { } }

implementation: StringBuffer b = new StringBuffer ( ) ; for ( int i = 0 ; i < name . length ( ) ; ++ i ) { char c = name . charAt ( i ) ; if ( c < 256 ) b . append ( c ) ; else b . append ( "\\U" ) . append ( toHexString ( ( int ) c ) ) ; } return b . toString ( ) ;


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

implementation: if ( cls . isArray ( ) || cls . isPrimitive ( ) ) throw IIOPLogger . ROOT_LOGGER . notAnClassOrInterface ( cls . getName ( ) ) ; if ( cls . isInterface ( ) && org . omg . CORBA . Object . class . isAssignableFrom ( cls ) && org . omg . CORBA . portable . IDLEntity . class . isAssignableFrom ( cls ) ) { StringBuffer b = new StringBuffer ( "IDL:" ) ; b . append ( cls . getPackage ( ) . getName ( ) . replace ( '.' , '/' ) ) ; b . append ( '/' ) ; String base = cls . getName ( ) ; base = base . substring ( base . lastIndexOf ( '.' ) + 1 ) ; b . append ( base ) . append ( ":1.0" ) ; repositoryId = b . toString ( ) ; } else { StringBuffer b = new StringBuffer ( "RMI:" ) ; b . append ( escapeIRName ( cls . getName ( ) ) ) ; memberPrefix = b . toString ( ) + "." ; String hashStr = toHexString ( classHashCode ) ; b . append ( ':' ) . append ( hashStr ) ; ObjectStreamClass osClass = ObjectStreamClass . lookup ( cls ) ; if ( osClass != null ) { long serialVersionUID = osClass . getSerialVersionUID ( ) ; String SVUID = toHexString ( serialVersionUID ) ; if ( classHashCode != serialVersionUID ) b . append ( ':' ) . append ( SVUID ) ; memberPostfix = ":" + hashStr + ":" + SVUID ; } else memberPostfix = ":" + hashStr ; repositoryId = b . toString ( ) ; }


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

implementation:
// no attributes
if ( reader . getAttributeCount ( ) > 0 ) { throw ParseUtils . unexpectedAttribute ( reader , 0 ) ; } final ModelNode subsystem = Util . getEmptyOperation ( ADD , PathAddress . pathAddress ( XTSExtension . SUBSYSTEM_PATH ) . toModelNode ( ) ) ; list . add ( subsystem ) ; final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; final List < Element > expected = getExpectedElements ( reader ) ; while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( ! expected . contains ( element ) || ! encountered . add ( element ) ) { throw ParseUtils . unexpectedElement ( reader ) ; } switch ( element ) { case HOST : { parseHostElement ( reader , subsystem ) ; break ; } case XTS_ENVIRONMENT : { parseXTSEnvironmentElement ( reader , subsystem ) ; break ; } case DEFAULT_CONTEXT_PROPAGATION : { parseDefaultContextPropagationElement ( reader , subsystem ) ; break ; } case ASYNC_REGISTRATION : { parseAsyncRegistrationElement ( reader , subsystem ) ; break ; } default : { throw ParseUtils . unexpectedElement ( reader ) ; } } }


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

implementation: context . startSubsystemElement ( Namespace . CURRENT . getUriString ( ) , false ) ; ModelNode node = context . getModelNode ( ) ; if ( node . hasDefined ( HOST_NAME . getName ( ) ) ) { writer . writeStartElement ( Element . HOST . getLocalName ( ) ) ; HOST_NAME . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } if ( node . hasDefined ( ENVIRONMENT_URL . getName ( ) ) ) { writer . writeStartElement ( Element . XTS_ENVIRONMENT . getLocalName ( ) ) ; ENVIRONMENT_URL . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } if ( node . hasDefined ( DEFAULT_CONTEXT_PROPAGATION . getName ( ) ) ) { writer . writeStartElement ( Element . DEFAULT_CONTEXT_PROPAGATION . getLocalName ( ) ) ; DEFAULT_CONTEXT_PROPAGATION . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } if ( node . hasDefined ( ASYNC_REGISTRATION . getName ( ) ) ) { writer . writeStartElement ( Element . ASYNC_REGISTRATION . getLocalName ( ) ) ; ASYNC_REGISTRATION . marshallAsAttribute ( node , writer ) ; writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ;


signature:
public class XTSSubsystemParser { /** * Handle the xts - environment element
 * @ param reader
 * @ param subsystem
 * @ return ModelNode for the core - environment
 * @ throws javax . xml . stream . XMLStreamException */
private void parseXTSEnvironmentElement ( XMLExtendedStreamReader reader , ModelNode subsystem ) throws XMLStreamException { } }

implementation:
processAttributes ( reader , ( index , attribute ) -> { final String value = reader . getAttributeValue ( index ) ; switch ( attribute ) { case URL : ENVIRONMENT_URL . parseAndSetParameter ( value , subsystem , reader ) ; break ; default : throw ParseUtils . unexpectedAttribute ( reader , index ) ; } } ) ; // Handle elements
ParseUtils . requireNoContent ( reader ) ;


signature:
public class XTSSubsystemParser { /** * Handle the enable - client - handler element .
 * @ param reader
 * @ param subsystem
 * @ throws XMLStreamException */
private void parseDefaultContextPropagationElement ( XMLExtendedStreamReader reader , ModelNode subsystem ) throws XMLStreamException { } }

implementation:
processAttributes ( reader , ( index , attribute ) -> { final String value = reader . getAttributeValue ( index ) ; switch ( attribute ) { case ENABLED : if ( value == null || ( ! value . toLowerCase ( ) . equals ( "true" ) && ! value . toLowerCase ( ) . equals ( "false" ) ) ) { throw ParseUtils . invalidAttributeValue ( reader , index ) ; } DEFAULT_CONTEXT_PROPAGATION . parseAndSetParameter ( value , subsystem , reader ) ; break ; default : throw ParseUtils . unexpectedAttribute ( reader , index ) ; } } ) ; // Handle elements
ParseUtils . requireNoContent ( reader ) ;


signature:
public class XTSSubsystemParser { /** * Iterating over all attributes got from the reader parameter .
 * @ param reader reading the parameters from
 * @ param attributeProcessorCallback callback being processed for each attribute
 * @ throws XMLStreamException troubles parsing xml */
private void processAttributes ( final XMLExtendedStreamReader reader , AttributeProcessor < Integer , Attribute > attributeProcessorCallback ) throws XMLStreamException { } }

implementation:
final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { ParseUtils . requireNoNamespaceAttribute ( reader , i ) ; // final String value = reader . getAttributeValue ( i ) ;
final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; attributeProcessorCallback . process ( i , attribute ) ; }


signature:
public class PersistenceProviderLoader { /** * Loads the specified JPA persistence provider module
 * @ param moduleName is the static module to be loaded
 * @ throws ModuleLoadException
 * @ return list of persistence providers in specified module
 * Note : side effect of saving loaded persistence providers to static api in javax . persistence . spi . PersistenceProvider . */
public static List < PersistenceProvider > loadProviderModuleByName ( String moduleName ) throws ModuleLoadException { } }

implementation:
final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; Module module = moduleLoader . loadModule ( ModuleIdentifier . fromString ( moduleName ) ) ; final ServiceLoader < PersistenceProvider > serviceLoader = module . loadService ( PersistenceProvider . class ) ; List < PersistenceProvider > result = new ArrayList < > ( ) ; if ( serviceLoader != null ) { for ( PersistenceProvider provider1 : serviceLoader ) { // persistence provider jar may contain multiple provider service implementations
// save each provider
PersistenceProviderResolverImpl . getInstance ( ) . addPersistenceProvider ( provider1 ) ; result . add ( provider1 ) ; } } return result ;


signature:
public class Main { /** * The main method .
 * @ param args the command - line arguments */
public static void main ( String [ ] args ) { } }

implementation:
if ( java . util . logging . LogManager . getLogManager ( ) . getClass ( ) . getName ( ) . equals ( "org.jboss.logmanager.LogManager" ) ) { // Make sure our original stdio is properly captured .
try { Class . forName ( org . jboss . logmanager . handlers . ConsoleHandler . class . getName ( ) , true , org . jboss . logmanager . handlers . ConsoleHandler . class . getClassLoader ( ) ) ; } catch ( Throwable ignored ) { } // Install JBoss Stdio to avoid any nasty crosstalk , after command line arguments are processed .
StdioContext . install ( ) ; final StdioContext context = StdioContext . create ( new NullInputStream ( ) , new LoggingOutputStream ( org . jboss . logmanager . Logger . getLogger ( "stdout" ) , org . jboss . logmanager . Level . INFO ) , new LoggingOutputStream ( org . jboss . logmanager . Logger . getLogger ( "stderr" ) , org . jboss . logmanager . Level . ERROR ) ) ; StdioContext . setStdioContextSelector ( new SimpleStdioContextSelector ( context ) ) ; } try { Module . registerURLStreamHandlerFactoryModule ( Module . getBootModuleLoader ( ) . loadModule ( ModuleIdentifier . create ( "org.jboss.vfs" ) ) ) ; final ParsedOptions options = determineEnvironment ( args , new Properties ( WildFlySecurityManager . getSystemPropertiesPrivileged ( ) ) , WildFlySecurityManager . getSystemEnvironmentPrivileged ( ) , ServerEnvironment . LaunchType . APPCLIENT ) ; if ( options == null ) { // this happens if - - version was specified
return ; } ServerEnvironment serverEnvironment = options . environment ; final List < String > clientArgs = options . clientArguments ; if ( clientArgs . isEmpty ( ) ) { STDERR . println ( AppClientLogger . ROOT_LOGGER . appClientNotSpecified ( ) ) ; usage ( ) ; abort ( null ) ; } else { final QName rootElement = new QName ( Namespace . CURRENT . getUriString ( ) , "server" ) ; final String file = clientArgs . get ( 0 ) ; final List < String > params = clientArgs . subList ( 1 , clientArgs . size ( ) ) ; final String deploymentName ; final String earPath ; int pos = file . lastIndexOf ( "#" ) ; if ( pos == - 1 ) { earPath = file ; deploymentName = null ; } else { deploymentName = file . substring ( pos + 1 ) ; earPath = file . substring ( 0 , pos ) ; } File realFile = new File ( earPath ) ; if ( ! realFile . exists ( ) ) { throw AppClientLogger . ROOT_LOGGER . cannotFindAppClientFile ( realFile . getAbsoluteFile ( ) ) ; } final Bootstrap bootstrap = Bootstrap . Factory . newInstance ( ) ; final Bootstrap . Configuration configuration = new Bootstrap . Configuration ( serverEnvironment ) ; configuration . setModuleLoader ( Module . getBootModuleLoader ( ) ) ; final ExtensionRegistry extensionRegistry = configuration . getExtensionRegistry ( ) ; final AppClientXml parser = new AppClientXml ( Module . getBootModuleLoader ( ) , extensionRegistry ) ; final Bootstrap . ConfigurationPersisterFactory configurationPersisterFactory = new Bootstrap . ConfigurationPersisterFactory ( ) { @ Override public ExtensibleConfigurationPersister createConfigurationPersister ( ServerEnvironment serverEnvironment , ExecutorService executorService ) { ApplicationClientConfigurationPersister persister = new ApplicationClientConfigurationPersister ( earPath , deploymentName , options . hostUrl , options . propertiesFile , params , serverEnvironment . getServerConfigurationFile ( ) . getBootFile ( ) , rootElement , parser ) ; for ( Namespace namespace : Namespace . domainValues ( ) ) { if ( ! namespace . equals ( Namespace . CURRENT ) ) { persister . registerAdditionalRootElement ( new QName ( namespace . getUriString ( ) , "server" ) , parser ) ; } } extensionRegistry . setWriterRegistry ( persister ) ; return persister ; } } ; configuration . setConfigurationPersisterFactory ( configurationPersisterFactory ) ; bootstrap . bootstrap ( configuration , Collections . < ServiceActivator > emptyList ( ) ) . get ( ) ; } } catch ( Throwable t ) { abort ( t ) ; }


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

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


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

implementation: String defined_in_id = "IR" ; if ( defined_in instanceof ContainedOperations ) defined_in_id = ( ( ContainedOperations ) defined_in ) . id ( ) ; AttributeDescription d = new AttributeDescription ( name , id , defined_in_id , version , typeCode , mode ) ; Any any = getORB ( ) . create_any ( ) ; AttributeDescriptionHelper . insert ( any , d ) ; return new Description ( DefinitionKind . dk_Attribute , any ) ;


signature:
public class ManagementHelper { /** * Create an ADD operation that can check that there is no other sibling when the resource is added .
 * @ param childType the type of children to check for the existence of siblings
 * @ param allowSibling whether it is allowed to have sibling for the resource that is added .
 * @ param attributes the attributes of the ADD operation */
static AbstractAddStepHandler createAddOperation ( final String childType , final boolean allowSibling , Collection < ? extends AttributeDefinition > attributes ) { } }

implementation: return new ActiveMQReloadRequiredHandlers . AddStepHandler ( attributes ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { super . execute ( context , operation ) ; if ( ! allowSibling ) { context . addStep ( checkNoOtherSibling ( childType ) , MODEL ) ; } } } ;


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

implementation: try { Connector cmd = mdr . getValue ( ) . getResourceAdapter ( deployment ) ; File root = mdr . getValue ( ) . getRoot ( deployment ) ; Activation localRaXml = getRaxml ( ) ; cmd = ( new Merger ( ) ) . mergeConnectorWithCommonIronJacamar ( localRaXml , cmd ) ; String id = ( ( ModifiableResourceAdapter ) raxml ) . getId ( ) ; final ServiceName raServiceName ; if ( id == null || id . trim ( ) . isEmpty ( ) ) { raServiceName = ConnectorServices . getResourceAdapterServiceName ( raName ) ; this . connectorServicesRegistrationName = raName ; } else { raServiceName = ConnectorServices . getResourceAdapterServiceName ( id ) ; this . connectorServicesRegistrationName = id ; } final WildFlyRaXmlDeployer raDeployer = new WildFlyRaXmlDeployer ( context . getChildTarget ( ) , connectorXmlDescriptor . getUrl ( ) , raName , root , module . getClassLoader ( ) , cmd , localRaXml , deploymentServiceName ) ; raDeployer . setConfiguration ( config . getValue ( ) ) ; WritableServiceBasedNamingStore . pushOwner ( duServiceName ) ; ClassLoader old = WildFlySecurityManager . getCurrentContextClassLoaderPrivileged ( ) ; try { WildFlySecurityManager . setCurrentContextClassLoaderPrivileged ( module . getClassLoader ( ) ) ; raxmlDeployment = raDeployer . doDeploy ( ) ; } finally { WildFlySecurityManager . setCurrentContextClassLoaderPrivileged ( old ) ; WritableServiceBasedNamingStore . popOwner ( ) ; } value = new ResourceAdapterDeployment ( raxmlDeployment , raName , raServiceName ) ; managementRepository . getValue ( ) . getConnectors ( ) . add ( value . getDeployment ( ) . getConnector ( ) ) ; registry . getValue ( ) . registerResourceAdapterDeployment ( value ) ; final ServiceBuilder raServiceSB = context . getChildTarget ( ) . addService ( raServiceName , new ResourceAdapterService ( raServiceName , value . getDeployment ( ) . getResourceAdapter ( ) ) ) ; raServiceSB . requires ( deploymentServiceName ) ; raServiceSB . setInitialMode ( ServiceController . Mode . ACTIVE ) . install ( ) ; } catch ( Throwable t ) { cleanupStartAsync ( context , raName , deploymentServiceName , t ) ; }


signature:
public class EjbDependencyDeploymentUnitProcessor { /** * Adds Java EE module as a dependency to any deployment unit which is an EJB deployment
 * @ param phaseContext the deployment unit context
 * @ throws DeploymentUnitProcessingException */
@ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } }

implementation:
// get hold of the deployment unit
DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( Attachments . MODULE_SPECIFICATION ) ; // always add EE API
moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , EJB_API , false , false , true , false ) ) ; // previously exported by EJB _ API prior to WFLY - 5922 TODO WFLY - 5967 look into moving this to WS subsystem
moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , JAX_RPC_API , false , false , true , false ) ) ; // we always give them the EJB client
moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , EJB_CLIENT , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , EJB_NAMING_CLIENT , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , EJB_IIOP_CLIENT , false , false , false , false ) ) ; // we always have to add this , as even non - ejb deployments may still lookup IIOP ejb ' s
moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , EJB_SUBSYSTEM , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , HTTP_EJB , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , HTTP_NAMING , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , HTTP_TRANSACTION , false , false , true , false ) ) ; if ( IIOPDeploymentMarker . isIIOPDeployment ( deploymentUnit ) ) { // needed for dynamic IIOP stubs
moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , IIOP_OPENJDK , false , false , false , false ) ) ; } // fetch the EjbJarMetaData
// TODO : remove the app client bit after the next EJB release
if ( ! isEjbDeployment ( deploymentUnit ) && ! DeploymentTypeMarker . isType ( DeploymentType . APPLICATION_CLIENT , deploymentUnit ) ) { // nothing to do
return ; } // FIXME : still not the best way to do it
// this must be the first dep listed in the module
if ( Boolean . getBoolean ( "org.jboss.as.ejb3.EMBEDDED" ) ) moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , ModuleIdentifier . CLASSPATH , false , false , false , false ) ) ;


signature:
public class HttpServletRequestPolicyContextHandler { /** * { @ inheritDoc } */
@ Override public Object getContext ( String key , Object data ) throws PolicyContextException { } }

implementation: if ( ! key . equalsIgnoreCase ( SecurityConstants . WEB_REQUEST_KEY ) ) return null ; return SecurityContextAssociationHandler . getActiveRequest ( ) ;


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

implementation:
context . startSubsystemElement ( Namespace . CURRENT . getUriString ( ) , false ) ; ModelNode node = context . getModelNode ( ) ; WebDefinition . DEFAULT_VIRTUAL_SERVER . marshallAsAttribute ( node , true , writer ) ; WebDefinition . INSTANCE_ID . marshallAsAttribute ( node , false , writer ) ; WebDefinition . NATIVE . marshallAsAttribute ( node , true , writer ) ; WebDefinition . DEFAULT_SESSION_TIMEOUT . marshallAsAttribute ( node , false , writer ) ; if ( node . hasDefined ( CONFIGURATION ) ) { writeContainerConfig ( writer , node . get ( CONFIGURATION ) ) ; } if ( node . hasDefined ( CONNECTOR ) ) { for ( final Property connector : node . get ( CONNECTOR ) . asPropertyList ( ) ) { final ModelNode config = connector . getValue ( ) ; writer . writeStartElement ( Element . CONNECTOR . getLocalName ( ) ) ; writer . writeAttribute ( NAME , connector . getName ( ) ) ; List < AttributeDefinition > connectorAttributes = new ArrayList < > ( Arrays . asList ( WebConnectorDefinition . CONNECTOR_ATTRIBUTES ) ) ; if ( config . hasDefined ( Constants . PROXY_BINDING ) ) { connectorAttributes . remove ( WebConnectorDefinition . PROXY_PORT ) ; connectorAttributes . remove ( WebConnectorDefinition . PROXY_NAME ) ; } else { connectorAttributes . remove ( WebConnectorDefinition . PROXY_BINDING ) ; } if ( config . hasDefined ( Constants . REDIRECT_BINDING ) ) { connectorAttributes . remove ( WebConnectorDefinition . REDIRECT_PORT ) ; } else { connectorAttributes . remove ( WebConnectorDefinition . REDIRECT_BINDING ) ; } for ( AttributeDefinition attr : connectorAttributes ) { if ( attr instanceof SimpleAttributeDefinition ) { ( ( SimpleAttributeDefinition ) attr ) . marshallAsAttribute ( config , true , writer ) ; } } if ( config . get ( SSL_PATH . getKey ( ) , SSL_PATH . getValue ( ) ) . isDefined ( ) ) { ModelNode sslConfig = config . get ( SSL_PATH . getKey ( ) , SSL_PATH . getValue ( ) ) ; writer . writeStartElement ( Element . SSL . getLocalName ( ) ) ; WebSSLDefinition . NAME . marshallAsAttribute ( sslConfig , writer ) ; for ( SimpleAttributeDefinition attr : WebSSLDefinition . SSL_ATTRIBUTES ) { attr . marshallAsAttribute ( sslConfig , false , writer ) ; } writer . writeEndElement ( ) ; } if ( config . hasDefined ( VIRTUAL_SERVER ) ) { for ( final ModelNode virtualServer : config . get ( VIRTUAL_SERVER ) . asList ( ) ) { writer . writeEmptyElement ( VIRTUAL_SERVER ) ; writer . writeAttribute ( NAME , virtualServer . asString ( ) ) ; } } writer . writeEndElement ( ) ; } } if ( node . hasDefined ( VIRTUAL_SERVER ) ) { for ( final Property host : node . get ( VIRTUAL_SERVER ) . asPropertyList ( ) ) { final ModelNode config = host . getValue ( ) ; writer . writeStartElement ( Element . VIRTUAL_SERVER . getLocalName ( ) ) ; writer . writeAttribute ( NAME , host . getName ( ) ) ; WebVirtualHostDefinition . ENABLE_WELCOME_ROOT . marshallAsAttribute ( config , true , writer ) ; WebVirtualHostDefinition . DEFAULT_WEB_MODULE . marshallAsAttribute ( config , true , writer ) ; if ( config . hasDefined ( ALIAS ) ) { for ( final ModelNode alias : config . get ( ALIAS ) . asList ( ) ) { writer . writeEmptyElement ( ALIAS ) ; writer . writeAttribute ( NAME , alias . asString ( ) ) ; } } if ( config . get ( ACCESS_LOG_PATH . getKey ( ) , ACCESS_LOG_PATH . getValue ( ) ) . isDefined ( ) ) { ModelNode accessLog = config . get ( ACCESS_LOG_PATH . getKey ( ) , ACCESS_LOG_PATH . getValue ( ) ) ; writer . writeStartElement ( Element . ACCESS_LOG . getLocalName ( ) ) ; for ( SimpleAttributeDefinition attr : WebAccessLogDefinition . ACCESS_LOG_ATTRIBUTES ) { attr . marshallAsAttribute ( accessLog , false , writer ) ; } if ( accessLog . get ( DIRECTORY_PATH . getKey ( ) , DIRECTORY_PATH . getValue ( ) ) . isDefined ( ) ) { ModelNode directory = accessLog . get ( DIRECTORY_PATH . getKey ( ) , DIRECTORY_PATH . getValue ( ) ) ; String name = Element . DIRECTORY . getLocalName ( ) ; boolean startwritten = false ; startwritten = writeAttribute ( writer , WebAccessLogDirectoryDefinition . PATH , directory , startwritten , name ) ; startwritten = writeAttribute ( writer , WebAccessLogDirectoryDefinition . RELATIVE_TO , directory , startwritten , name ) ; if ( startwritten ) { writer . writeEndElement ( ) ; } } writer . writeEndElement ( ) ; } if ( config . hasDefined ( REWRITE ) ) { for ( final ModelNode rewritenode : config . get ( REWRITE ) . asList ( ) ) { Property prop = rewritenode . asProperty ( ) ; ModelNode rewrite = prop . getValue ( ) ; writer . writeStartElement ( REWRITE ) ; writer . writeAttribute ( NAME , prop . getName ( ) ) ; WebReWriteDefinition . PATTERN . marshallAsAttribute ( rewrite , false , writer ) ; WebReWriteDefinition . SUBSTITUTION . marshallAsAttribute ( rewrite , false , writer ) ; WebReWriteDefinition . FLAGS . marshallAsAttribute ( rewrite , false , writer ) ; if ( rewrite . hasDefined ( CONDITION ) ) { for ( final ModelNode conditionnode : rewrite . get ( CONDITION ) . asList ( ) ) { Property conditionProp = conditionnode . asProperty ( ) ; ModelNode condition = conditionProp . getValue ( ) ; writer . writeStartElement ( CONDITION ) ; writer . writeAttribute ( NAME , conditionProp . getName ( ) ) ; WebReWriteConditionDefinition . TEST . marshallAsAttribute ( condition , false , writer ) ; WebReWriteConditionDefinition . PATTERN . marshallAsAttribute ( condition , false , writer ) ; WebReWriteConditionDefinition . FLAGS . marshallAsAttribute ( condition , false , writer ) ; writer . writeEndElement ( ) ; } } writer . writeEndElement ( ) ; } } if ( config . get ( SSO_PATH . getKey ( ) , SSO_PATH . getValue ( ) ) . isDefined ( ) ) { final ModelNode sso ; sso = config . get ( SSO_PATH . getKey ( ) , SSO_PATH . getValue ( ) ) ; writer . writeStartElement ( SSO ) ; for ( SimpleAttributeDefinition attr : WebSSODefinition . SSO_ATTRIBUTES ) { attr . marshallAsAttribute ( sso , false , writer ) ; } writer . writeEndElement ( ) ; } // End of the VIRTUAL _ SERVER
writer . writeEndElement ( ) ; } if ( node . hasDefined ( VALVE ) ) { for ( final Property valve : node . get ( VALVE ) . asPropertyList ( ) ) { final ModelNode config = valve . getValue ( ) ; writer . writeStartElement ( Element . VALVE . getLocalName ( ) ) ; writer . writeAttribute ( NAME , valve . getName ( ) ) ; for ( AttributeDefinition attr : WebValveDefinition . ATTRIBUTES ) { if ( attr instanceof SimpleAttributeDefinition ) { ( ( SimpleAttributeDefinition ) attr ) . marshallAsAttribute ( config , false , writer ) ; } } if ( config . hasDefined ( PARAM ) ) { for ( final Property entry : config . get ( PARAM ) . asPropertyList ( ) ) { writer . writeEmptyElement ( Element . PARAM . getLocalName ( ) ) ; writer . writeAttribute ( Attribute . PARAM_NAME . getLocalName ( ) , entry . getName ( ) ) ; writer . writeAttribute ( Attribute . PARAM_VALUE . getLocalName ( ) , entry . getValue ( ) . asString ( ) ) ; } } writer . writeEndElement ( ) ; } } } writer . writeEndElement ( ) ;


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

implementation:
PathAddress address = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , WebExtension . SUBSYSTEM_NAME ) ) ; final ModelNode subsystem = new ModelNode ( ) ; subsystem . get ( OP ) . set ( ADD ) ; subsystem . get ( OP_ADDR ) . set ( address . toModelNode ( ) ) ; 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 NATIVE : WebDefinition . NATIVE . parseAndSetParameter ( value , subsystem , reader ) ; break ; case DEFAULT_VIRTUAL_SERVER : WebDefinition . DEFAULT_VIRTUAL_SERVER . parseAndSetParameter ( value , subsystem , reader ) ; break ; case INSTANCE_ID : WebDefinition . INSTANCE_ID . parseAndSetParameter ( value , subsystem , reader ) ; break ; case DEFAULT_SESSION_TIMEOUT : attributeSupportedSince ( Namespace . WEB_2_2 , reader , i ) ; WebDefinition . DEFAULT_SESSION_TIMEOUT . parseAndSetParameter ( value , subsystem , reader ) ; break ; default : throw unexpectedAttribute ( reader , i ) ; } } list . add ( subsystem ) ; boolean containerConfigDefined = false ; final Namespace namespace = Namespace . forUri ( reader . getNamespaceURI ( ) ) ; // elements
while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { switch ( namespace ) { case WEB_1_0 : case WEB_1_1 : case WEB_1_2 : case WEB_1_3 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; switch ( element ) { case CONTAINER_CONFIG : { parseContainerConfig ( reader , address , list ) ; containerConfigDefined = true ; break ; } case CONNECTOR : { parseConnector ( reader , address , list ) ; break ; } case VIRTUAL_SERVER : { parseHost ( reader , address , list ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } break ; } case WEB_1_4 : case WEB_1_5 : case WEB_2_0 : case WEB_2_1 : case WEB_2_2 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; switch ( element ) { case CONTAINER_CONFIG : { parseContainerConfig ( reader , address , list ) ; containerConfigDefined = true ; break ; } case CONNECTOR : { parseConnector ( reader , address , list ) ; break ; } case VIRTUAL_SERVER : { parseHost ( reader , address , list ) ; break ; } case VALVE : { parseValve ( reader , address , list ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } break ; } default : { throw unexpectedElement ( reader ) ; } } } if ( ! containerConfigDefined ) { addDefaultContainerConfig ( address , list ) ; }


signature:
public class WebSubsystemParser { /** * todo , attribute . marshallAsAttribute should return boolean */
private boolean writeAttribute ( XMLExtendedStreamWriter writer , SimpleAttributeDefinition attribute , ModelNode node , boolean startWriten , String origin ) throws XMLStreamException { } }

implementation: if ( attribute . isMarshallable ( node , false ) ) { if ( ! startWriten ) { startWriten = true ; writer . writeStartElement ( origin ) ; } attribute . marshallAsAttribute ( node , false , writer ) ; } return startWriten ;


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

implementation: super . registerOperations ( registration ) ; registration . registerOperationHandler ( GenericSubsystemDescribeHandler . DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ;


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

implementation: final Runnable task = new Runnable ( ) { @ Override public void run ( ) { try { getValue ( ) . start ( ) ; context . complete ( ) ; } catch ( Throwable e ) { context . failed ( new StartException ( e ) ) ; } } } ; try { executor . getValue ( ) . submit ( task ) ; } catch ( RejectedExecutionException e ) { task . run ( ) ; } finally { context . asynchronous ( ) ; }


signature:
public class EjbCorbaServant { /** * Receives IIOP requests to this servant ' s < code > EJBObject < / code > s
 * and forwards them to the bean container , through the JBoss
 * < code > MBean < / code > server . */
public OutputStream _invoke ( final String opName , final InputStream in , final ResponseHandler handler ) { } }

implementation:
EjbLogger . ROOT_LOGGER . tracef ( "EJBObject invocation: %s" , opName ) ; SkeletonStrategy op = methodInvokerMap . get ( opName ) ; if ( op == null ) { EjbLogger . ROOT_LOGGER . debugf ( "Unable to find opname '%s' valid operations:%s" , opName , methodInvokerMap . keySet ( ) ) ; throw new BAD_OPERATION ( opName ) ; } final NamespaceContextSelector selector = componentView . getComponent ( ) . getNamespaceContextSelector ( ) ; final ClassLoader oldCl = WildFlySecurityManager . getCurrentContextClassLoaderPrivileged ( ) ; NamespaceContextSelector . pushCurrentSelector ( selector ) ; try { WildFlySecurityManager . setCurrentContextClassLoaderPrivileged ( classLoader ) ; org . omg . CORBA_2_3 . portable . OutputStream out ; try { Object retVal ; if ( ! home && opName . equals ( "_get_handle" ) ) { retVal = new HandleImplIIOP ( orb . object_to_string ( _this_object ( ) ) ) ; } else if ( home && opName . equals ( "_get_homeHandle" ) ) { retVal = homeHandle ; } else if ( home && opName . equals ( "_get_EJBMetaData" ) ) { retVal = ejbMetaData ; } else { Principal identityPrincipal = null ; Principal principal = null ; Object credential = null ; if ( this . sasCurrent != null ) { final byte [ ] incomingIdentity = this . sasCurrent . get_incoming_principal_name ( ) ; // we have an identity token , which is a trust based mechanism
if ( incomingIdentity != null && incomingIdentity . length > 0 ) { String name = new String ( incomingIdentity , StandardCharsets . UTF_8 ) ; int domainIndex = name . indexOf ( '@' ) ; if ( domainIndex > 0 ) name = name . substring ( 0 , domainIndex ) ; identityPrincipal = new NamePrincipal ( name ) ; } final byte [ ] incomingUsername = this . sasCurrent . get_incoming_username ( ) ; if ( incomingUsername != null && incomingUsername . length > 0 ) { final byte [ ] incomingPassword = this . sasCurrent . get_incoming_password ( ) ; String name = new String ( incomingUsername , StandardCharsets . UTF_8 ) ; int domainIndex = name . indexOf ( '@' ) ; if ( domainIndex > 0 ) { name = name . substring ( 0 , domainIndex ) ; } principal = new NamePrincipal ( name ) ; credential = new String ( incomingPassword , StandardCharsets . UTF_8 ) . toCharArray ( ) ; } } final Object [ ] params = op . readParams ( ( org . omg . CORBA_2_3 . portable . InputStream ) in ) ; if ( ! this . home && opName . equals ( "isIdentical" ) && params . length == 1 ) { // handle isIdentical specially
Object val = params [ 0 ] ; retVal = val instanceof org . omg . CORBA . Object && handleIsIdentical ( ( org . omg . CORBA . Object ) val ) ; } else { if ( this . securityDomain != null ) { // an elytron security domain is available : authenticate and authorize the client before invoking the component .
SecurityIdentity identity = this . securityDomain . getAnonymousSecurityIdentity ( ) ; AuthenticationConfiguration authenticationConfiguration = AuthenticationConfiguration . EMPTY ; if ( identityPrincipal != null ) { // we have an identity token principal - check if the TLS identity , if available ,
// has permission to run as the identity token principal .
// TODO use the TLS identity when that becomes available to us .
// no TLS identity found , check if an initial context token was also sent . If it was ,
// authenticate the incoming username / password and check if the resulting identity has
// permission to run as the identity token principal .
if ( principal != null ) { char [ ] password = ( char [ ] ) credential ; authenticationConfiguration = authenticationConfiguration . useName ( principal . getName ( ) ) . usePassword ( password ) ; SecurityIdentity authenticatedIdentity = this . authenticate ( principal , password ) ; identity = authenticatedIdentity . createRunAsIdentity ( identityPrincipal . getName ( ) , true ) ; } else { // no TLS nor initial context token found - check if the anonymous identity has
// permission to run as the identity principal .
identity = this . securityDomain . getAnonymousSecurityIdentity ( ) . createRunAsIdentity ( identityPrincipal . getName ( ) , true ) ; } } else if ( principal != null ) { char [ ] password = ( char [ ] ) credential ; // we have an initial context token containing a username / password pair .
authenticationConfiguration = authenticationConfiguration . useName ( principal . getName ( ) ) . usePassword ( password ) ; identity = this . authenticate ( principal , password ) ; } final InterceptorContext interceptorContext = new InterceptorContext ( ) ; this . prepareInterceptorContext ( op , params , interceptorContext ) ; try { final AuthenticationContext context = AuthenticationContext . captureCurrent ( ) . with ( MatchRule . ALL . matchProtocol ( "iiop" ) , authenticationConfiguration ) ; retVal = identity . runAs ( ( PrivilegedExceptionAction < Object > ) ( ) -> context . run ( ( PrivilegedExceptionAction < Object > ) ( ) -> this . componentView . invoke ( interceptorContext ) ) ) ; } catch ( PrivilegedActionException e ) { throw e . getCause ( ) ; } } else { // legacy security behavior : setup the security context if a SASCurrent is available and invoke the component .
// One of the EJB security interceptors will authenticate and authorize the client .
SecurityContext legacyContext = null ; if ( this . legacySecurityDomain != null && ( identityPrincipal != null || principal != null ) ) { // we don ' t have any real way to establish trust in identity based auth so we just use
// the SASCurrent as a credential , and a custom legacy login module can make a decision for us .
final Object finalCredential = identityPrincipal != null ? this . sasCurrent : credential ; final Principal finalPrincipal = identityPrincipal != null ? identityPrincipal : principal ; if ( WildFlySecurityManager . isChecking ( ) ) { legacyContext = AccessController . doPrivileged ( ( PrivilegedExceptionAction < SecurityContext > ) ( ) -> { SecurityContext sc = SecurityContextFactory . createSecurityContext ( this . legacySecurityDomain ) ; sc . getUtil ( ) . createSubjectInfo ( finalPrincipal , finalCredential , null ) ; return sc ; } ) ; } else { legacyContext = SecurityContextFactory . createSecurityContext ( this . legacySecurityDomain ) ; legacyContext . getUtil ( ) . createSubjectInfo ( finalPrincipal , finalCredential , null ) ; } } if ( legacyContext != null ) { setSecurityContextOnAssociation ( legacyContext ) ; } try { final InterceptorContext interceptorContext = new InterceptorContext ( ) ; if ( legacyContext != null ) { interceptorContext . putPrivateData ( SecurityContext . class , legacyContext ) ; } prepareInterceptorContext ( op , params , interceptorContext ) ; retVal = this . componentView . invoke ( interceptorContext ) ; } finally { if ( legacyContext != null ) { clearSecurityContextOnAssociation ( ) ; } } } } } out = ( org . omg . CORBA_2_3 . portable . OutputStream ) handler . createReply ( ) ; if ( op . isNonVoid ( ) ) { op . writeRetval ( out , retVal ) ; } } catch ( Throwable e ) { EjbLogger . ROOT_LOGGER . trace ( "Exception in EJBObject invocation" , e ) ; if ( e instanceof MBeanException ) { e = ( ( MBeanException ) e ) . getTargetException ( ) ; } RmiIdlUtil . rethrowIfCorbaSystemException ( e ) ; out = ( org . omg . CORBA_2_3 . portable . OutputStream ) handler . createExceptionReply ( ) ; op . writeException ( out , e ) ; } return out ; } finally { NamespaceContextSelector . popCurrentSelector ( ) ; WildFlySecurityManager . setCurrentContextClassLoaderPrivileged ( oldCl ) ; }


signature:
public class EjbCorbaServant { /** * Receives intra - VM invocations on this servant ' s < code > EJBObject < / code > s
 * and forwards them to the bean container , through the JBoss
 * < code > MBean < / code >
 * server . */
public Object invoke ( String opName , Object [ ] arguments , Transaction tx , Principal identity , Object credential ) throws Exception { } }

implementation: EjbLogger . ROOT_LOGGER . tracef ( "EJBObject local invocation: %s" , opName ) ; SkeletonStrategy op = methodInvokerMap . get ( opName ) ; if ( op == null ) { throw new BAD_OPERATION ( opName ) ; } if ( tx != null ) { transactionManager . resume ( tx ) ; } try { final InterceptorContext interceptorContext = new InterceptorContext ( ) ; prepareInterceptorContext ( op , arguments , interceptorContext ) ; return componentView . invoke ( interceptorContext ) ; } finally { if ( tx != null ) { if ( transactionManager . getStatus ( ) != Status . STATUS_NO_TRANSACTION ) { transactionManager . suspend ( ) ; } } }


signature:
public class EjbCorbaServant { /** * Authenticate the user with the given credential against the configured Elytron security domain .
 * @ param principal the principal representing the user being authenticated .
 * @ param credential the credential used as evidence to verify the user ' s identity .
 * @ return the authenticated and authorized { @ link SecurityIdentity } .
 * @ throws Exception if an error occurs while authenticating the user . */
private SecurityIdentity authenticate ( final Principal principal , final char [ ] credential ) throws Exception { } }

implementation: final ServerAuthenticationContext context = this . securityDomain . createNewAuthenticationContext ( ) ; final PasswordGuessEvidence evidence = new PasswordGuessEvidence ( credential != null ? credential : null ) ; try { context . setAuthenticationPrincipal ( principal ) ; if ( context . verifyEvidence ( evidence ) ) { if ( context . authorize ( ) ) { context . succeed ( ) ; return context . getAuthorizedIdentity ( ) ; } else { context . fail ( ) ; throw new SecurityException ( "Authorization failed" ) ; } } else { context . fail ( ) ; throw new SecurityException ( "Authentication failed" ) ; } } catch ( IllegalArgumentException | IllegalStateException | RealmUnavailableException e ) { context . fail ( ) ; throw e ; } finally { evidence . destroy ( ) ; }


signature:
public class MethodIntfHelper { /** * centralize this hack */
public static MethodIntf of ( final InterceptorContext invocation ) { } }

implementation:
// for timer invocations there is no view , so the methodInf is attached directly
// to the context . Otherwise we retrieve it from the invoked view
MethodIntf methodIntf = invocation . getPrivateData ( MethodIntf . class ) ; if ( methodIntf == null ) { final ComponentView componentView = invocation . getPrivateData ( ComponentView . class ) ; if ( componentView != null ) { methodIntf = componentView . getPrivateData ( MethodIntf . class ) ; } else { methodIntf = MethodIntf . BEAN ; } } return methodIntf ;


signature:
public class EjbJndiBindingsDeploymentUnitProcessor { /** * Sets up jndi bindings for each of the views exposed by the passed < code > sessionBean < / code >
 * @ param sessionBean The session bean
 * @ param deploymentUnit The deployment unit containing the session bean */
private void setupJNDIBindings ( EJBComponentDescription sessionBean , DeploymentUnit deploymentUnit ) throws DeploymentUnitProcessingException { } }

implementation:
final Collection < ViewDescription > views = sessionBean . getViews ( ) ; if ( views == null || views . isEmpty ( ) ) { EjbLogger . DEPLOYMENT_LOGGER . noJNDIBindingsForSessionBean ( sessionBean . getEJBName ( ) ) ; return ; } // In case of EJB bindings , appname = = . ear file name / application - name set in the application . xml ( if it ' s an . ear deployment )
// NOTE : Do NOT use the app name from the EEModuleDescription . getApplicationName ( ) because the Java EE spec has a different and conflicting meaning for app name
// ( where app name = = module name in the absence of a . ear ) . Use EEModuleDescription . getEarApplicationName ( ) instead
final String applicationName = sessionBean . getModuleDescription ( ) . getEarApplicationName ( ) ; final String distinctName = sessionBean . getModuleDescription ( ) . getDistinctName ( ) ; // default to empty string
final String globalJNDIBaseName = "java:global/" + ( applicationName != null ? applicationName + "/" : "" ) + sessionBean . getModuleName ( ) + "/" + sessionBean . getEJBName ( ) ; final String appJNDIBaseName = "java:app/" + sessionBean . getModuleName ( ) + "/" + sessionBean . getEJBName ( ) ; final String moduleJNDIBaseName = "java:module/" + sessionBean . getEJBName ( ) ; final String remoteExportedJNDIBaseName = "java:jboss/exported/" + ( applicationName != null ? applicationName + "/" : "" ) + sessionBean . getModuleName ( ) + "/" + sessionBean . getEJBName ( ) ; final String ejbNamespaceBindingBaseName = "ejb:" + ( applicationName != null ? applicationName : "" ) + "/" + sessionBean . getModuleName ( ) + "/" + ( distinctName != "" ? distinctName + "/" : "" ) + sessionBean . getEJBName ( ) ; // the base ServiceName which will be used to create the ServiceName ( s ) for each of the view bindings
final StringBuilder jndiBindingsLogMessage = new StringBuilder ( ) ; jndiBindingsLogMessage . append ( System . lineSeparator ( ) ) . append ( System . lineSeparator ( ) ) ; // now create the bindings for each view under the java : global , java : app and java : module namespaces
EJBViewDescription ejbViewDescription = null ; for ( ViewDescription viewDescription : views ) { ejbViewDescription = ( EJBViewDescription ) viewDescription ; if ( appclient && ejbViewDescription . getMethodIntf ( ) != MethodIntf . REMOTE && ejbViewDescription . getMethodIntf ( ) != MethodIntf . HOME ) { continue ; } if ( ! ejbViewDescription . hasJNDIBindings ( ) ) continue ; final String viewClassName = ejbViewDescription . getViewClassName ( ) ; // java : global bindings
final String globalJNDIName = globalJNDIBaseName + "!" + viewClassName ; registerBinding ( sessionBean , viewDescription , globalJNDIName ) ; logBinding ( jndiBindingsLogMessage , globalJNDIName ) ; // java : app bindings
final String appJNDIName = appJNDIBaseName + "!" + viewClassName ; registerBinding ( sessionBean , viewDescription , appJNDIName ) ; logBinding ( jndiBindingsLogMessage , appJNDIName ) ; // java : module bindings
final String moduleJNDIName = moduleJNDIBaseName + "!" + viewClassName ; registerBinding ( sessionBean , viewDescription , moduleJNDIName ) ; logBinding ( jndiBindingsLogMessage , moduleJNDIName ) ; // If it a remote or ( remote ) home view then bind the java : jboss / exported jndi names for the view
if ( ejbViewDescription . getMethodIntf ( ) == MethodIntf . REMOTE || ejbViewDescription . getMethodIntf ( ) == MethodIntf . HOME ) { final String remoteJNDIName = remoteExportedJNDIBaseName + "!" + viewClassName ; if ( RequestControllerActivationMarker . isRequestControllerEnabled ( deploymentUnit ) ) { registerControlPointBinding ( sessionBean , viewDescription , remoteJNDIName , deploymentUnit ) ; } else { registerBinding ( sessionBean , viewDescription , remoteJNDIName ) ; } logBinding ( jndiBindingsLogMessage , remoteJNDIName ) ; } // log EJB ' s ejb : / namespace binding
final String ejbNamespaceBindingName = sessionBean . isStateful ( ) ? ejbNamespaceBindingBaseName + "!" + viewClassName + "?stateful" : ejbNamespaceBindingBaseName + "!" + viewClassName ; logBinding ( jndiBindingsLogMessage , ejbNamespaceBindingName ) ; } // EJB3.1 spec , section 4.4.1 Global JNDI Access states :
// In addition to the previous requirements , if the bean exposes only one of the
// applicable client interfaces ( or alternatively has only a no - interface view ) , the container
// registers an entry for that view with the following syntax :
// java : global [ / < app - name > ] / < module - name > / < bean - name >
// Note that this also applies to java : app and java : module bindings
// as can be seen by the examples in 4.4.2.1
if ( views . size ( ) == 1 ) { final EJBViewDescription viewDescription = ( EJBViewDescription ) views . iterator ( ) . next ( ) ; if ( ejbViewDescription . hasJNDIBindings ( ) ) { // java : global binding
registerBinding ( sessionBean , viewDescription , globalJNDIBaseName ) ; logBinding ( jndiBindingsLogMessage , globalJNDIBaseName ) ; // java : app binding
registerBinding ( sessionBean , viewDescription , appJNDIBaseName ) ; logBinding ( jndiBindingsLogMessage , appJNDIBaseName ) ; // java : module binding
registerBinding ( sessionBean , viewDescription , moduleJNDIBaseName ) ; logBinding ( jndiBindingsLogMessage , moduleJNDIBaseName ) ; } } // log the jndi bindings
EjbLogger . DEPLOYMENT_LOGGER . jndiBindings ( sessionBean . getEJBName ( ) , deploymentUnit , jndiBindingsLogMessage ) ;


signature:
public class StatefulSessionComponent { /** * creates a session using the global request controller .
 * This should only be used by callers that service remote requests ( i . e . places that represent a remote entry point into the container )
 * @ return The session id */
public SessionID createSessionRemote ( ) { } }

implementation: ControlPoint controlPoint = getControlPoint ( ) ; if ( controlPoint == null ) { return createSession ( ) ; } else { try { RunResult result = controlPoint . beginRequest ( ) ; if ( result == RunResult . REJECTED ) { throw EjbLogger . ROOT_LOGGER . containerSuspended ( ) ; } try { return createSession ( ) ; } finally { controlPoint . requestComplete ( ) ; } } catch ( EJBComponentUnavailableException | ComponentIsStoppedException e ) { throw e ; } catch ( Exception e ) { throw new EJBException ( e ) ; } }


signature:
public class JMSServerControlHandler { /** * Infer the name of the JMS destination based on the queue ' s address . */
private String inferDestinationName ( String address ) { } }

implementation: if ( address . startsWith ( JMS_QUEUE_PREFIX ) ) { return address . substring ( JMS_QUEUE_PREFIX . length ( ) ) ; } else if ( address . startsWith ( JMS_TOPIC_PREFIX ) ) { return address . substring ( JMS_TOPIC_PREFIX . length ( ) ) ; } else { return address ; }


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

implementation:
final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; AbstractSecurityDeployer < ? > deployer = null ; if ( DeploymentTypeMarker . isType ( DeploymentType . EAR , deploymentUnit ) ) { deployer = new EarSecurityDeployer ( ) ; JaccService < ? > service = deployer . deploy ( deploymentUnit ) ; if ( service != null ) { final ServiceName jaccServiceName = deploymentUnit . getServiceName ( ) . append ( JaccService . SERVICE_NAME ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; ServiceBuilder < ? > builder = serviceTarget . addService ( jaccServiceName , service ) ; if ( deploymentUnit . getParent ( ) != null ) { // add dependency to parent policy
final DeploymentUnit parentDU = deploymentUnit . getParent ( ) ; builder . addDependency ( parentDU . getServiceName ( ) . append ( JaccService . SERVICE_NAME ) , PolicyConfiguration . class , service . getParentPolicyInjector ( ) ) ; } builder . setInitialMode ( Mode . ACTIVE ) . install ( ) ; } }


signature:
public class JaccEarDeploymentProcessor { /** * { @ inheritDoc } */
@ Override public void undeploy ( DeploymentUnit context ) { } }

implementation: AbstractSecurityDeployer < ? > deployer = null ; if ( DeploymentTypeMarker . isType ( DeploymentType . EAR , context ) ) { deployer = new EarSecurityDeployer ( ) ; deployer . undeploy ( context ) ; }


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

implementation: final JMSServerManager jmsManager = jmsServer . getValue ( ) ; final Runnable task = new Runnable ( ) { @ Override public void run ( ) { try { jmsManager . createConnectionFactory ( false , configuration , configuration . getBindings ( ) ) ; context . complete ( ) ; } catch ( Throwable e ) { context . failed ( MessagingLogger . ROOT_LOGGER . failedToCreate ( e , "connection-factory" ) ) ; } } } ; try { executorInjector . getValue ( ) . execute ( task ) ; } catch ( RejectedExecutionException e ) { task . run ( ) ; } finally { context . asynchronous ( ) ; }


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

implementation:
final JMSServerManager jmsManager = jmsServer . getValue ( ) ; final Runnable task = new Runnable ( ) { @ Override public void run ( ) { try { jmsManager . destroyConnectionFactory ( name ) ; } catch ( Throwable e ) { MessagingLogger . ROOT_LOGGER . failedToDestroy ( "connection-factory" , name ) ; } context . complete ( ) ; } } ; // JMS Server Manager uses locking which waits on service completion , use async to prevent starvation
try { executorInjector . getValue ( ) . execute ( task ) ; } catch ( RejectedExecutionException e ) { task . run ( ) ; } finally { context . asynchronous ( ) ; }


signature:
public class CMTTxInterceptor { /** * The < code > endTransaction < / code > method ends a transaction and
 * translates any exceptions into
 * TransactionRolledBack [ Local ] Exception or SystemException .
 * @ param tx a < code > Transaction < / code > value */
protected void endTransaction ( final Transaction tx ) { } }

implementation:
ContextTransactionManager tm = ContextTransactionManager . getInstance ( ) ; try { if ( ! tx . equals ( tm . getTransaction ( ) ) ) { throw EjbLogger . ROOT_LOGGER . wrongTxOnThread ( tx , tm . getTransaction ( ) ) ; } final int txStatus = tx . getStatus ( ) ; if ( txStatus == Status . STATUS_ACTIVE ) { // Commit tx
// This will happen if
// a ) everything goes well
// b ) app . exception was thrown
tm . commit ( ) ; } else if ( txStatus == Status . STATUS_MARKED_ROLLBACK ) { tm . rollback ( ) ; } else if ( txStatus == Status . STATUS_ROLLEDBACK || txStatus == Status . STATUS_ROLLING_BACK ) { // handle reaper canceled ( rolled back ) tx case ( see WFLY - 1346)
// clear current tx state and throw RollbackException ( EJBTransactionRolledbackException )
tm . rollback ( ) ; throw EjbLogger . ROOT_LOGGER . transactionAlreadyRolledBack ( tx ) ; } else if ( txStatus == Status . STATUS_UNKNOWN ) { // STATUS _ UNKNOWN isn ' t expected to be reached here but if it does , we need to clear current thread tx .
// It is possible that calling tm . commit ( ) could succeed but we call tm . rollback , since this is an unexpected
// tx state that are are handling .
tm . rollback ( ) ; // if the tm . rollback doesn ' t fail , we throw an EJBException to reflect the unexpected tx state .
throw EjbLogger . ROOT_LOGGER . transactionInUnexpectedState ( tx , statusAsString ( txStatus ) ) ; } else { // logically , all of the following ( unexpected ) tx states are handled here :
// Status . STATUS _ PREPARED
// Status . STATUS _ PREPARING
// Status . STATUS _ COMMITTING
// Status . STATUS _ NO _ TRANSACTION
// Status . STATUS _ COMMITTED
tm . suspend ( ) ; // clear current tx state and throw EJBException
throw EjbLogger . ROOT_LOGGER . transactionInUnexpectedState ( tx , statusAsString ( txStatus ) ) ; } } catch ( RollbackException e ) { throw new EJBTransactionRolledbackException ( e . toString ( ) , e ) ; } catch ( HeuristicMixedException | SystemException | HeuristicRollbackException e ) { throw new EJBException ( e ) ; }


signature:
public class CMTTxInterceptor { /** * The < code > setRollbackOnly < / code > method calls setRollbackOnly ( )
 * on the invocation ' s transaction and logs any exceptions than may
 * occur .
 * @ param tx the transaction
 * @ param t the exception to add problems to ( may be { @ code null } ) */
protected void setRollbackOnly ( Transaction tx , final Throwable t ) { } }

implementation: try { tx . setRollbackOnly ( ) ; } catch ( Throwable t2 ) { EjbLogger . ROOT_LOGGER . failedToSetRollbackOnly ( t2 ) ; if ( t != null ) { t . addSuppressed ( t2 ) ; } }


signature:
public class ModClusterUndertowDeploymentProcessor { /** * Checks whether this { @ link Class } is configured to be used .
 * @ param metricClass Class to check whether it ' s configured to be used
 * @ return true if any of the enabled metrics is enabled , false otherwise */
private boolean isMetricEnabled ( Class metricClass ) { } }

implementation: for ( LoadMetric enabledMetric : enabledMetrics ) { if ( metricClass . isInstance ( enabledMetric ) ) { return true ; } } return false ;


signature:
public class WSEndpointHandlersMapping { /** * Registers endpoint and its associated WS handlers .
 * @ param endpointClass WS endpoint
 * @ param endpointHandlers WS handlers associated with endpoint */
public void registerEndpointHandlers ( final String endpointClass , final Set < String > endpointHandlers ) { } }

implementation: if ( ( endpointClass == null ) || ( endpointHandlers == null ) ) { throw new IllegalArgumentException ( ) ; } endpointHandlersMap . put ( endpointClass , Collections . unmodifiableSet ( endpointHandlers ) ) ;


signature:
public class EJBTransformers { /** * This transformer does the following :
 * - maps < passivation - store / > to < cluster - passivation - store / >
 * - sets appropriate defaults for IDLE _ TIMEOUT , IDLE _ TIMEOUT _ UNIT , PASSIVATE _ EVENTS _ ON _ REPLICATE , and CLIENT _ MAPPINGS _ CACHE */
@ SuppressWarnings ( "deprecation" ) private static void registerPassivationStoreTransformers_1_2_1_and_1_3_0 ( ResourceTransformationDescriptionBuilder parent ) { } }

implementation: ResourceTransformationDescriptionBuilder child = parent . addChildRedirection ( PassivationStoreResourceDefinition . INSTANCE . getPathElement ( ) , PathElement . pathElement ( EJB3SubsystemModel . CLUSTER_PASSIVATION_STORE ) ) ; child . getAttributeBuilder ( ) . setValueConverter ( AttributeConverter . Factory . createHardCoded ( new ModelNode ( true ) , true ) , EJB3SubsystemModel . PASSIVATE_EVENTS_ON_REPLICATE ) . setValueConverter ( AttributeConverter . Factory . createHardCoded ( new ModelNode ( "default" ) , true ) , EJB3SubsystemModel . CLIENT_MAPPINGS_CACHE ) . setValueConverter ( AttributeConverter . Factory . createHardCoded ( new ModelNode ( ) . set ( Long . valueOf ( Integer . MAX_VALUE ) ) , true ) , EJB3SubsystemModel . IDLE_TIMEOUT ) . setValueConverter ( AttributeConverter . Factory . createHardCoded ( new ModelNode ( ) . set ( TimeUnit . SECONDS . name ( ) ) , true ) , EJB3SubsystemModel . IDLE_TIMEOUT_UNIT ) ;


signature:
public class CorbaPOAService { /** * Create the { @ code Policy } array containing the { @ code POA } policies using the values specified in the constructor .
 * When creating a { @ code POA } , the parent { @ code POA } is responsible for generating the relevant policies beforehand .
 * @ param poa the { @ code POA } used to create the { @ code Policy } objects .
 * @ return the constructed { @ code Policy } array . */
private Policy [ ] createPolicies ( POA poa ) { } }

implementation: List < Policy > policies = new ArrayList < Policy > ( ) ; if ( this . sslOnly ) policies . add ( ZeroPortPolicy . getPolicy ( ) ) ; if ( this . idAssignmentPolicyValue != null ) policies . add ( poa . create_id_assignment_policy ( this . idAssignmentPolicyValue ) ) ; if ( this . idUniquenessPolicyValue != null ) policies . add ( poa . create_id_uniqueness_policy ( this . idUniquenessPolicyValue ) ) ; if ( this . implicitActivationPolicyValue != null ) policies . add ( poa . create_implicit_activation_policy ( this . implicitActivationPolicyValue ) ) ; if ( this . lifespanPolicyValue != null ) policies . add ( poa . create_lifespan_policy ( this . lifespanPolicyValue ) ) ; if ( this . requestProcessingPolicyValue != null ) policies . add ( poa . create_request_processing_policy ( this . requestProcessingPolicyValue ) ) ; if ( this . servantRetentionPolicyValue != null ) policies . add ( poa . create_servant_retention_policy ( this . servantRetentionPolicyValue ) ) ; if ( this . threadPolicyValue != null ) policies . add ( poa . create_thread_policy ( this . threadPolicyValue ) ) ; return policies . toArray ( new Policy [ policies . size ( ) ] ) ;


signature:
public class IIOPStubCompiler { /** * Generates the code of a given method within a stub class .
 * @ param asm the < code > ProxyAssembler < / code > used to assemble
 * the method code
 * @ param superclass the superclass of the stub class within which the
 * method will be generated
 * @ param m a < code > Method < / code > instance describing the
 * method declaration by an RMI / IDL interface
 * @ param idlName a string with the method name mapped to IDL
 * @ param strategyField a string with the name of the strategy field that
 * will be associated with the generated method
 * @ param initMethod a string with the name of the static initialization
 * method that will be associated with the generated
 * method . */
private static void generateMethodCode ( ClassFile asm , Class < ? > superclass , Method m , String idlName , String strategyField , String initMethod ) { } }

implementation:
Class < ? > returnType = m . getReturnType ( ) ; Class < ? > [ ] paramTypes = m . getParameterTypes ( ) ; Class < ? > [ ] exceptions = m . getExceptionTypes ( ) ; // Generate a static field with the StubStrategy for the method
asm . addField ( Modifier . PRIVATE + Modifier . STATIC , strategyField , StubStrategy . class ) ; // Generate the method code
final CodeAttribute ca = asm . addMethod ( m ) . getCodeAttribute ( ) ; // The method code issues a call
// super . invoke * ( idlName , strategyField , args )
ca . aload ( 0 ) ; ca . ldc ( idlName ) ; ca . getstatic ( asm . getName ( ) , strategyField , StubStrategy . class ) ; // Push args
if ( paramTypes . length == 0 ) { ca . iconst ( 0 ) ; ca . anewarray ( Object . class . getName ( ) ) ; // asm . pushField ( Util . class , " NOARGS " ) ;
} else { ca . iconst ( paramTypes . length ) ; ca . anewarray ( Object . class . getName ( ) ) ; int index = 1 ; for ( int j = 0 ; j < paramTypes . length ; j ++ ) { Class < ? > type = paramTypes [ j ] ; ca . dup ( ) ; ca . iconst ( j ) ; if ( ! type . isPrimitive ( ) ) { // object or array
ca . aload ( index ) ; } else if ( type . equals ( double . class ) ) { ca . dload ( index ) ; Boxing . boxDouble ( ca ) ; index ++ ; } else if ( type . equals ( long . class ) ) { ca . lload ( index ) ; Boxing . boxLong ( ca ) ; index ++ ; } else if ( type . equals ( float . class ) ) { ca . fload ( index ) ; Boxing . boxFloat ( ca ) ; } else { ca . iload ( index ) ; Boxing . boxIfNessesary ( ca , DescriptorUtils . makeDescriptor ( type ) ) ; } index ++ ; ca . aastore ( ) ; } } // Generate the call to an invoke * method ot the superclass
String invoke = "invoke" ; String ret = "Ljava/lang/Object;" ; if ( returnType . isPrimitive ( ) && returnType != Void . TYPE ) { String typeName = returnType . getName ( ) ; invoke += ( Character . toUpperCase ( typeName . charAt ( 0 ) ) + typeName . substring ( 1 ) ) ; ret = DescriptorUtils . makeDescriptor ( returnType ) ; } ca . invokevirtual ( superclass . getName ( ) , invoke , "(Ljava/lang/String;Lorg/wildfly/iiop/openjdk/rmi/marshal/strategy/StubStrategy;[Ljava/lang/Object;)" + ret ) ; if ( ! returnType . isPrimitive ( ) && returnType != Object . class ) { ca . checkcast ( returnType ) ; } ca . returnInstruction ( ) ; // Generate a static method that initializes the method ' s strategy field
final CodeAttribute init = asm . addMethod ( Modifier . PRIVATE + Modifier . STATIC , initMethod , "V" ) . getCodeAttribute ( ) ; int i ; int len ; // Push first argument for StubStrategy constructor :
// array with abbreviated names of the param marshallers
len = paramTypes . length ; init . iconst ( len ) ; init . anewarray ( String . class . getName ( ) ) ; for ( i = 0 ; i < len ; i ++ ) { init . dup ( ) ; init . iconst ( i ) ; init . ldc ( CDRStream . abbrevFor ( paramTypes [ i ] ) ) ; init . aastore ( ) ; } // Push second argument for StubStrategy constructor :
// array with exception repository ids
len = exceptions . length ; int n = 0 ; for ( i = 0 ; i < len ; i ++ ) { if ( ! RemoteException . class . isAssignableFrom ( exceptions [ i ] ) ) { n ++ ; } } init . iconst ( n ) ; init . anewarray ( String . class . getName ( ) ) ; try { int j = 0 ; for ( i = 0 ; i < len ; i ++ ) { if ( ! RemoteException . class . isAssignableFrom ( exceptions [ i ] ) ) { init . dup ( ) ; init . iconst ( j ) ; init . ldc ( ExceptionAnalysis . getExceptionAnalysis ( exceptions [ i ] ) . getExceptionRepositoryId ( ) ) ; init . aastore ( ) ; j ++ ; } } } catch ( RMIIIOPViolationException e ) { throw EjbLogger . ROOT_LOGGER . exceptionRepositoryNotFound ( exceptions [ i ] . getName ( ) , e . getLocalizedMessage ( ) ) ; } // Push third argument for StubStrategy constructor :
// array with exception class names
init . iconst ( n ) ; init . anewarray ( String . class . getName ( ) ) ; int j = 0 ; for ( i = 0 ; i < len ; i ++ ) { if ( ! RemoteException . class . isAssignableFrom ( exceptions [ i ] ) ) { init . dup ( ) ; init . iconst ( j ) ; init . ldc ( exceptions [ i ] . getName ( ) ) ; init . aastore ( ) ; j ++ ; } } // Push fourth argument for StubStrategy constructor :
// abbreviated name of the return value marshaller
init . ldc ( CDRStream . abbrevFor ( returnType ) ) ; // Push fifth argument for StubStrategy constructor :
// null ( no ClassLoader specified )
init . aconstNull ( ) ; // Constructs the StubStrategy
init . invokestatic ( StubStrategy . class . getName ( ) , "forMethod" , "([Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/ClassLoader;)Lorg/wildfly/iiop/openjdk/rmi/marshal/strategy/StubStrategy;" ) ; // Set the strategy field of this stub class
init . putstatic ( asm . getName ( ) , strategyField , StubStrategy . class ) ; init . returnInstruction ( ) ;


signature:
public class IIOPStubCompiler { /** * Generates the bytecodes of a stub class for a given interface .
 * @ param interfaceAnalysis an < code > InterfaceAnalysis < / code > instance
 * describing the RMI / IIOP interface to be
 * implemented by the stub class
 * @ param superclass the superclass of the stub class
 * @ param stubClassName the name of the stub class
 * @ return a byte array with the generated bytecodes . */
private static ClassFile generateCode ( InterfaceAnalysis interfaceAnalysis , Class < ? > superclass , String stubClassName ) { } }

implementation:
final ClassFile asm = new ClassFile ( stubClassName , superclass . getName ( ) , null , ModuleClassFactory . INSTANCE , interfaceAnalysis . getCls ( ) . getName ( ) ) ; int methodIndex = 0 ; AttributeAnalysis [ ] attrs = interfaceAnalysis . getAttributes ( ) ; for ( int i = 0 ; i < attrs . length ; i ++ ) { OperationAnalysis op = attrs [ i ] . getAccessorAnalysis ( ) ; generateMethodCode ( asm , superclass , op . getMethod ( ) , op . getIDLName ( ) , strategy ( methodIndex ) , init ( methodIndex ) ) ; methodIndex ++ ; op = attrs [ i ] . getMutatorAnalysis ( ) ; if ( op != null ) { generateMethodCode ( asm , superclass , op . getMethod ( ) , op . getIDLName ( ) , strategy ( methodIndex ) , init ( methodIndex ) ) ; methodIndex ++ ; } } final OperationAnalysis [ ] ops = interfaceAnalysis . getOperations ( ) ; for ( int i = 0 ; i < ops . length ; i ++ ) { generateMethodCode ( asm , superclass , ops [ i ] . getMethod ( ) , ops [ i ] . getIDLName ( ) , strategy ( methodIndex ) , init ( methodIndex ) ) ; methodIndex ++ ; } // Generate the constructor
final ClassMethod ctor = asm . addMethod ( Modifier . PUBLIC , "<init>" , "V" ) ; ctor . getCodeAttribute ( ) . aload ( 0 ) ; ctor . getCodeAttribute ( ) . invokespecial ( superclass . getName ( ) , "<init>" , "()V" ) ; ctor . getCodeAttribute ( ) . returnInstruction ( ) ; // Generate the method _ ids ( ) , declared as abstract in ObjectImpl
final String [ ] ids = interfaceAnalysis . getAllTypeIds ( ) ; asm . addField ( Modifier . PRIVATE + Modifier . STATIC , ID_FIELD_NAME , String [ ] . class ) ; final CodeAttribute idMethod = asm . addMethod ( Modifier . PUBLIC + Modifier . FINAL , "_ids" , "[Ljava/lang/String;" ) . getCodeAttribute ( ) ; idMethod . getstatic ( stubClassName , ID_FIELD_NAME , "[Ljava/lang/String;" ) ; idMethod . returnInstruction ( ) ; // Generate the static initializer
final CodeAttribute clinit = asm . addMethod ( Modifier . STATIC , "<clinit>" , "V" ) . getCodeAttribute ( ) ; clinit . iconst ( ids . length ) ; clinit . anewarray ( String . class . getName ( ) ) ; for ( int i = 0 ; i < ids . length ; i ++ ) { clinit . dup ( ) ; clinit . iconst ( i ) ; clinit . ldc ( ids [ i ] ) ; clinit . aastore ( ) ; } clinit . putstatic ( stubClassName , ID_FIELD_NAME , "[Ljava/lang/String;" ) ; int n = methodIndex ; // last methodIndex + 1
for ( methodIndex = 0 ; methodIndex < n ; methodIndex ++ ) { clinit . invokestatic ( stubClassName , init ( methodIndex ) , "()V" ) ; } clinit . returnInstruction ( ) ; return asm ;


signature:
public class IIOPStubCompiler { /** * Generates the bytecodes of a stub class for a given interface .
 * @ param interfaceAnalysis an < code > InterfaceAnalysis < / code > instance
 * describing the RMI / IIOP interface to be
 * implemented by the stub class
 * @ param superclass the superclass of the stub class
 * @ param stubClassName the name of the stub class
 * @ return a byte array with the generated bytecodes . */
private static ClassFile makeCode ( InterfaceAnalysis interfaceAnalysis , Class < ? > superclass , String stubClassName ) { } }

implementation:
ClassFile code = generateCode ( interfaceAnalysis , superclass , stubClassName ) ; // try {
// String fname = stubClassName ;
// fname = fname . substring ( 1 + fname . lastIndexOf ( ' . ' ) ) + " . class " ;
// fname = " / tmp / " + fname ;
// java . io . OutputStream cf = new java . io . FileOutputStream ( fname ) ;
// cf . write ( code ) ;
// cf . close ( ) ;
// System . err . println ( " wrote " + fname ) ;
// catch ( java . io . IOException ee ) {
return code ;


signature:
public class IIOPStubCompiler { /** * Generates the bytecodes of a stub class for a given interface .
 * @ param intf RMI / IIOP interface to be implemented by the
 * stub class
 * @ param stubClassName the name of the stub class
 * @ return a byte array with the generated bytecodes ; */
public static ClassFile compile ( Class < ? > intf , String stubClassName ) { } }

implementation: InterfaceAnalysis interfaceAnalysis = null ; try { interfaceAnalysis = InterfaceAnalysis . getInterfaceAnalysis ( intf ) ; } catch ( RMIIIOPViolationException e ) { throw EjbLogger . ROOT_LOGGER . rmiIiopVoliation ( e . getLocalizedMessage ( ) ) ; } return makeCode ( interfaceAnalysis , DynamicIIOPStub . class , stubClassName ) ;