idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
22,000
public PathElement getLastElement ( ) { final List < PathElement > list = pathAddressList ; return list . size ( ) == 0 ? null : list . get ( list . size ( ) - 1 ) ; }
Gets the last element in the address .
22,001
public PathAddress append ( List < PathElement > additionalElements ) { final ArrayList < PathElement > newList = new ArrayList < PathElement > ( pathAddressList . size ( ) + additionalElements . size ( ) ) ; newList . addAll ( pathAddressList ) ; newList . addAll ( additionalElements ) ; return pathAddress ( newList )...
Create a new path address by appending more elements to the end of this address .
22,002
public ModelNode navigate ( ModelNode model , boolean create ) throws NoSuchElementException { final Iterator < PathElement > i = pathAddressList . iterator ( ) ; while ( i . hasNext ( ) ) { final PathElement element = i . next ( ) ; if ( create && ! i . hasNext ( ) ) { if ( element . isMultiTarget ( ) ) { throw new Il...
Navigate to this address in the given model node .
22,003
public ModelNode remove ( ModelNode model ) throws NoSuchElementException { final Iterator < PathElement > i = pathAddressList . iterator ( ) ; while ( i . hasNext ( ) ) { final PathElement element = i . next ( ) ; if ( i . hasNext ( ) ) { model = model . require ( element . getKey ( ) ) . require ( element . getValue ...
Navigate to and remove this address in the given model node .
22,004
public ModelNode toModelNode ( ) { final ModelNode node = new ModelNode ( ) . setEmptyList ( ) ; for ( PathElement element : pathAddressList ) { final String value ; if ( element . isMultiTarget ( ) && ! element . isWildcard ( ) ) { value = '[' + element . getValue ( ) + ']' ; } else { value = element . getValue ( ) ; ...
Convert this path address to its model node representation .
22,005
public boolean matches ( PathAddress address ) { if ( address == null ) { return false ; } if ( equals ( address ) ) { return true ; } if ( size ( ) != address . size ( ) ) { return false ; } for ( int i = 0 ; i < size ( ) ; i ++ ) { PathElement pe = getElement ( i ) ; PathElement other = address . getElement ( i ) ; i...
Check if this path matches the address path . An address matches this address if its path elements match or are valid multi targets for this path elements . Addresses that are equal are matching .
22,006
public static void indexResourceRoot ( final ResourceRoot resourceRoot ) throws DeploymentUnitProcessingException { if ( resourceRoot . getAttachment ( Attachments . ANNOTATION_INDEX ) != null ) { return ; } VirtualFile indexFile = resourceRoot . getRoot ( ) . getChild ( ModuleIndexBuilder . INDEX_LOCATION ) ; if ( ind...
Creates and attaches the annotation index to a resource root if it has not already been attached
22,007
public static void validateRollbackState ( final String patchID , final InstalledIdentity identity ) throws PatchingException { final Set < String > validHistory = processRollbackState ( patchID , identity ) ; if ( patchID != null && ! validHistory . contains ( patchID ) ) { throw PatchLogger . ROOT_LOGGER . patchNotFo...
Validate the consistency of patches to the point we rollback .
22,008
public static void mark ( DeploymentUnit unit ) { unit = DeploymentUtils . getTopDeploymentUnit ( unit ) ; unit . putAttachment ( MARKER , Boolean . TRUE ) ; }
Mark the top level deployment as being a JPA deployment . If the deployment is not a top level deployment the parent is marked instead
22,009
public Map < String , Set < String > > cleanObsoleteContent ( ) { if ( ! readWrite ) { return Collections . emptyMap ( ) ; } Map < String , Set < String > > cleanedContents = new HashMap < > ( 2 ) ; cleanedContents . put ( MARKED_CONTENT , new HashSet < > ( ) ) ; cleanedContents . put ( DELETED_CONTENT , new HashSet < ...
Clean obsolete contents from the content repository . It will first mark contents as obsolete then after some time if these contents are still obsolete they will be removed .
22,010
private boolean markAsObsolete ( ContentReference ref ) { if ( obsoleteContents . containsKey ( ref . getHexHash ( ) ) ) { if ( obsoleteContents . get ( ref . getHexHash ( ) ) + obsolescenceTimeout < System . currentTimeMillis ( ) ) { DeploymentRepositoryLogger . ROOT_LOGGER . obsoleteContentCleaned ( ref . getContentI...
Mark content as obsolete . If content was already marked for obsolescenceTimeout ms then it is removed .
22,011
static ReadMasterDomainModelUtil readMasterDomainResourcesForInitialConnect ( final Transformers transformers , final Transformers . TransformationInputs transformationInputs , final Transformers . ResourceIgnoredTransformationRegistry ignoredTransformationRegistry , final Resource domainRoot ) throws OperationFailedEx...
Used to read the domain model when a slave host connects to the DC
22,012
private List < ModelNode > describeAsNodeList ( PathAddress rootAddress , final Resource resource , boolean isRuntimeChange ) { final List < ModelNode > list = new ArrayList < ModelNode > ( ) ; describe ( rootAddress , resource , list , isRuntimeChange ) ; return list ; }
Describe the model as a list of resources with their address and model which the HC can directly apply to create the model . Although the format might appear similar as the operations generated at boot - time this description is only useful to create the resource tree and cannot be used to invoke any operation .
22,013
public static RequiredConfigurationHolder populateHostResolutionContext ( final HostInfo hostInfo , final Resource root , final ExtensionRegistry extensionRegistry ) { final RequiredConfigurationHolder rc = new RequiredConfigurationHolder ( ) ; for ( IgnoredNonAffectedServerGroupsUtil . ServerConfigInfo info : hostInfo...
Process the host info and determine which configuration elements are required on the slave host .
22,014
static void processServerConfig ( final Resource root , final RequiredConfigurationHolder requiredConfigurationHolder , final IgnoredNonAffectedServerGroupsUtil . ServerConfigInfo serverConfig , final ExtensionRegistry extensionRegistry ) { final Set < String > serverGroups = requiredConfigurationHolder . serverGroups ...
Determine the relevant pieces of configuration which need to be included when processing the domain model .
22,015
public static Transformers . ResourceIgnoredTransformationRegistry createServerIgnoredRegistry ( final RequiredConfigurationHolder rc , final Transformers . ResourceIgnoredTransformationRegistry delegate ) { return new Transformers . ResourceIgnoredTransformationRegistry ( ) { public boolean isResourceTransformationIgn...
Create the ResourceIgnoredTransformationRegistry when fetching missing content only including relevant pieces to a server - config .
22,016
public static ModelNode addCurrentServerGroupsToHostInfoModel ( boolean ignoreUnaffectedServerGroups , Resource hostModel , ModelNode model ) { if ( ! ignoreUnaffectedServerGroups ) { return model ; } model . get ( IGNORE_UNUSED_CONFIG ) . set ( ignoreUnaffectedServerGroups ) ; addServerGroupsToModel ( hostModel , mode...
Used by the slave host when creating the host info dmr sent across to the DC during the registration process
22,017
public boolean ignoreOperation ( final Resource domainResource , final Collection < ServerConfigInfo > serverConfigs , final PathAddress pathAddress ) { if ( pathAddress . size ( ) == 0 ) { return false ; } boolean ignore = ignoreResourceInternal ( domainResource , serverConfigs , pathAddress ) ; return ignore ; }
For the DC to check whether an operation should be ignored on the slave if the slave is set up to ignore config not relevant to it
22,018
public Set < ServerConfigInfo > getServerConfigsOnSlave ( Resource hostResource ) { Set < ServerConfigInfo > groups = new HashSet < > ( ) ; for ( ResourceEntry entry : hostResource . getChildren ( SERVER_CONFIG ) ) { groups . add ( new ServerConfigInfoImpl ( entry . getModel ( ) ) ) ; } return groups ; }
For use on a slave HC to get all the server groups used by the host
22,019
private static boolean syncWithMaster ( final Resource domain , final PathElement hostElement ) { final Resource host = domain . getChild ( hostElement ) ; assert host != null ; final Set < String > profiles = new HashSet < > ( ) ; final Set < String > serverGroups = new HashSet < > ( ) ; final Set < String > socketBin...
Determine whether all references are available locally .
22,020
public Result cmd ( String cliCommand ) { try { if ( ctx . isWorkflowMode ( ) || ctx . isBatchMode ( ) ) { ctx . handle ( cliCommand ) ; return new Result ( cliCommand , ctx . getExitCode ( ) ) ; } handler . parse ( ctx . getCurrentNodePath ( ) , cliCommand , ctx ) ; if ( handler . getFormat ( ) == OperationFormat . IN...
Execute a CLI command . This can be any command that you might execute on the CLI command line including both server - side operations and local commands such as cd or cn .
22,021
protected void boot ( final BootContext context ) throws ConfigurationPersistenceException { List < ModelNode > bootOps = configurationPersister . load ( ) ; ModelNode op = registerModelControllerServiceInitializationBootStep ( context ) ; if ( op != null ) { bootOps . add ( op ) ; } boot ( bootOps , false ) ; finishBo...
Boot the controller . Called during service start .
22,022
protected boolean boot ( List < ModelNode > bootOperations , boolean rollbackOnRuntimeFailure ) throws ConfigurationPersistenceException { return boot ( bootOperations , rollbackOnRuntimeFailure , false , ModelControllerImpl . getMutableRootResourceRegistrationProvider ( ) ) ; }
Boot with the given operations performing full model and capability registry validation .
22,023
public static < T > T getBundle ( final Class < T > type ) { return doPrivileged ( new PrivilegedAction < T > ( ) { public T run ( ) { final Locale locale = Locale . getDefault ( ) ; final String lang = locale . getLanguage ( ) ; final String country = locale . getCountry ( ) ; final String variant = locale . getVarian...
Get a message bundle of the given type .
22,024
public String getName ( ) { if ( name == null && securityIdentity != null ) { name = securityIdentity . getPrincipal ( ) . getName ( ) ; } return name ; }
Obtain the name of the caller most likely a user but could also be a remote process .
22,025
public String getRealm ( ) { if ( UNDEFINED . equals ( realm ) ) { Principal principal = securityIdentity . getPrincipal ( ) ; String realm = null ; if ( principal instanceof RealmPrincipal ) { realm = ( ( RealmPrincipal ) principal ) . getRealm ( ) ; } this . realm = realm ; } return this . realm ; }
Obtain the realm used for authentication .
22,026
private ModelNode resolveSubsystems ( final List < ModelNode > extensions ) { HostControllerLogger . ROOT_LOGGER . debug ( "Applying extensions provided by master" ) ; final ModelNode result = operationExecutor . installSlaveExtensions ( extensions ) ; if ( ! SUCCESS . equals ( result . get ( OUTCOME ) . asString ( ) )...
Resolve the subsystem versions .
22,027
private boolean applyRemoteDomainModel ( final List < ModelNode > bootOperations , final HostInfo hostInfo ) { try { HostControllerLogger . ROOT_LOGGER . debug ( "Applying domain level boot operations provided by master" ) ; SyncModelParameters parameters = new SyncModelParameters ( domainController , ignoredDomainReso...
Apply the remote domain model to the local host controller .
22,028
static void rethrowIrrecoverableConnectionFailures ( IOException e ) throws SlaveRegistrationException { Throwable cause = e ; while ( ( cause = cause . getCause ( ) ) != null ) { if ( cause instanceof SaslException ) { throw HostControllerLogger . ROOT_LOGGER . authenticationFailureUnableToConnect ( cause ) ; } else i...
Analyzes a failure thrown connecting to the master for causes that indicate some problem not likely to be resolved by immediately retrying . If found throws an exception highlighting the underlying cause . If the cause is not one of the ones understood by this method the method returns normally .
22,029
static void logConnectionException ( URI uri , DiscoveryOption discoveryOption , boolean moreOptions , Exception e ) { if ( uri == null ) { HostControllerLogger . ROOT_LOGGER . failedDiscoveringMaster ( discoveryOption , e ) ; } else { HostControllerLogger . ROOT_LOGGER . cannotConnect ( uri , e ) ; } if ( ! moreOption...
Handles logging tasks related to a failure to connect to a remote HC .
22,030
public static AliasOperationTransformer replaceLastElement ( final PathElement element ) { return create ( new AddressTransformer ( ) { public PathAddress transformAddress ( final PathAddress original ) { final PathAddress address = original . subAddress ( 0 , original . size ( ) - 1 ) ; return address . append ( eleme...
Replace the last element of an address with a static path element .
22,031
void persist ( final String key , final String value , final boolean enableDisableMode , final boolean disable , final File file ) throws IOException , StartException { persist ( key , value , enableDisableMode , disable , file , null ) ; }
Implement the persistence handler for storing the group properties .
22,032
void persist ( final String key , final String value , final boolean enableDisableMode , final boolean disable , final File file , final String realm ) throws IOException , StartException { final PropertiesFileLoader propertiesHandler = realm == null ? new PropertiesFileLoader ( file . getAbsolutePath ( ) , null ) : ne...
Implement the persistence handler for storing the user properties .
22,033
public static ServiceName deploymentUnitName ( String name , Phase phase ) { return JBOSS_DEPLOYMENT_UNIT . append ( name , phase . name ( ) ) ; }
Get the service name of a top - level deployment unit .
22,034
protected void updateModel ( final ModelNode operation , final Resource resource ) throws OperationFailedException { updateModel ( operation , resource . getModel ( ) ) ; }
Update the given resource in the persistent configuration model based on the values in the given operation .
22,035
public void logAttributeWarning ( PathAddress address , String attribute ) { logAttributeWarning ( address , null , null , attribute ) ; }
Log a warning for the resource at the provided address and a single attribute . The detail message is a default Attributes are not understood in the target model version and this resource will need to be ignored on the target host .
22,036
public void logAttributeWarning ( PathAddress address , Set < String > attributes ) { logAttributeWarning ( address , null , null , attributes ) ; }
Log a warning for the resource at the provided address and the given attributes . The detail message is a default Attributes are not understood in the target model version and this resource will need to be ignored on the target host .
22,037
public void logAttributeWarning ( PathAddress address , String message , String attribute ) { logAttributeWarning ( address , null , message , attribute ) ; }
Log warning for the resource at the provided address and single attribute using the provided detail message .
22,038
public void logAttributeWarning ( PathAddress address , String message , Set < String > attributes ) { messageQueue . add ( new AttributeLogEntry ( address , null , message , attributes ) ) ; }
Log a warning for the resource at the provided address and the given attributes using the provided detail message .
22,039
public void logAttributeWarning ( PathAddress address , ModelNode operation , String message , String attribute ) { messageQueue . add ( new AttributeLogEntry ( address , operation , message , attribute ) ) ; }
Log a warning for the given operation at the provided address for the given attribute using the provided detail message .
22,040
public void logAttributeWarning ( PathAddress address , ModelNode operation , String message , Set < String > attributes ) { messageQueue . add ( new AttributeLogEntry ( address , operation , message , attributes ) ) ; }
Log a warning for the given operation at the provided address for the given attributes using the provided detail message .
22,041
public void logWarning ( final String message ) { messageQueue . add ( new LogEntry ( ) { public String getMessage ( ) { return message ; } } ) ; }
Log a free - form warning
22,042
void flushLogQueue ( ) { Set < String > problems = new LinkedHashSet < String > ( ) ; synchronized ( messageQueue ) { Iterator < LogEntry > i = messageQueue . iterator ( ) ; while ( i . hasNext ( ) ) { problems . add ( "\t\t" + i . next ( ) . getMessage ( ) + "\n" ) ; i . remove ( ) ; } } if ( ! problems . isEmpty ( ) ...
flushes log queue this actually writes combined log message into system log
22,043
PatchEntry getEntry ( final String name , boolean addOn ) { return addOn ? addOns . get ( name ) : layers . get ( name ) ; }
Get a patch entry for either a layer or add - on .
22,044
protected void failedToCleanupDir ( final File file ) { checkForGarbageOnRestart = true ; PatchLogger . ROOT_LOGGER . cannotDeleteFile ( file . getAbsolutePath ( ) ) ; }
In case we cannot delete a directory create a marker to recheck whether we can garbage collect some not referenced directories and files .
22,045
protected PatchEntry resolveForElement ( final PatchElement element ) throws PatchingException { assert state == State . NEW ; final PatchElementProvider provider = element . getProvider ( ) ; final String layerName = provider . getName ( ) ; final LayerType layerType = provider . getLayerType ( ) ; final Map < String ...
Get the target entry for a given patch element .
22,046
private void complete ( final InstallationManager . InstallationModification modification , final FinalizeCallback callback ) { final List < File > processed = new ArrayList < File > ( ) ; List < File > reenabled = Collections . emptyList ( ) ; List < File > disabled = Collections . emptyList ( ) ; try { try { if ( sta...
Complete the current operation and persist the current state to the disk . This will also trigger the invalidation of outdated modules .
22,047
boolean undoChanges ( ) { final State state = stateUpdater . getAndSet ( this , State . ROLLBACK_ONLY ) ; if ( state == State . COMPLETED || state == State . ROLLBACK_ONLY ) { return false ; } PatchingTaskContext . Mode currentMode = this . mode ; mode = PatchingTaskContext . Mode . UNDO ; final PatchContentLoader load...
Internally undo recorded changes we did so far .
22,048
static void undoChanges ( final PatchEntry entry , final PatchContentLoader loader ) { final List < ContentModification > modifications = new ArrayList < ContentModification > ( entry . rollbackActions ) ; for ( final ContentModification modification : modifications ) { final ContentItem item = modification . getItem (...
Undo changes for a single patch entry .
22,049
private void recordRollbackLoader ( final String patchId , PatchableTarget . TargetInfo target ) { final DirectoryStructure structure = target . getDirectoryStructure ( ) ; final InstalledImage image = structure . getInstalledImage ( ) ; final File historyDir = image . getPatchHistoryDir ( patchId ) ; final File miscRo...
Add a rollback loader for a give patch .
22,050
protected void recordContentLoader ( final String patchID , final PatchContentLoader contentLoader ) { if ( contentLoaders . containsKey ( patchID ) ) { throw new IllegalStateException ( "Content loader already registered for patch " + patchID ) ; } contentLoaders . put ( patchID , contentLoader ) ; }
Record a content loader for a given patch id .
22,051
public File getTargetFile ( final MiscContentItem item ) { final State state = this . state ; if ( state == State . NEW || state == State . ROLLBACK_ONLY ) { return getTargetFile ( miscTargetRoot , item ) ; } else { throw new IllegalStateException ( ) ; } }
Get the target file for misc items .
22,052
protected Patch createProcessedPatch ( final Patch original ) { final List < PatchElement > elements = new ArrayList < PatchElement > ( ) ; for ( final PatchEntry entry : getLayers ( ) ) { final PatchElement element = createPatchElement ( entry , entry . element . getId ( ) , entry . modifications ) ; elements . add ( ...
Create a patch representing what we actually processed . This may contain some fixed content hashes for removed modules .
22,053
protected RollbackPatch createRollbackPatch ( final String patchId , final Patch . PatchType patchType ) { final List < PatchElement > elements = new ArrayList < PatchElement > ( ) ; for ( final PatchEntry entry : getLayers ( ) ) { final PatchElement element = createRollbackElement ( entry ) ; elements . add ( element ...
Create a rollback patch based on the recorded actions .
22,054
static File getTargetFile ( final File root , final MiscContentItem item ) { return PatchContentLoader . getMiscPath ( root , item ) ; }
Get a misc file .
22,055
protected static PatchElement createRollbackElement ( final PatchEntry entry ) { final PatchElement patchElement = entry . element ; final String patchId ; final Patch . PatchType patchType = patchElement . getProvider ( ) . getPatchType ( ) ; if ( patchType == Patch . PatchType . CUMULATIVE ) { patchId = entry . getCu...
Create a patch element for the rollback patch .
22,056
protected static PatchElement createPatchElement ( final PatchEntry entry , String patchId , final List < ContentModification > modifications ) { final PatchElement patchElement = entry . element ; final PatchElementImpl element = new PatchElementImpl ( patchId ) ; element . setProvider ( patchElement . getProvider ( )...
Copy a patch element
22,057
void backupConfiguration ( ) throws IOException { final String configuration = Constants . CONFIGURATION ; final File a = new File ( installedImage . getAppClientDir ( ) , configuration ) ; final File d = new File ( installedImage . getDomainDir ( ) , configuration ) ; final File s = new File ( installedImage . getStan...
Backup the current configuration as part of the patch history .
22,058
static void backupDirectory ( final File source , final File target ) throws IOException { if ( ! target . exists ( ) ) { if ( ! target . mkdirs ( ) ) { throw PatchLogger . ROOT_LOGGER . cannotCreateDirectory ( target . getAbsolutePath ( ) ) ; } } final File [ ] files = source . listFiles ( CONFIG_FILTER ) ; for ( fina...
Backup all xml files in a given directory .
22,059
static void writePatch ( final Patch rollbackPatch , final File file ) throws IOException { final File parent = file . getParentFile ( ) ; if ( ! parent . isDirectory ( ) ) { if ( ! parent . mkdirs ( ) && ! parent . exists ( ) ) { throw PatchLogger . ROOT_LOGGER . cannotCreateDirectory ( file . getAbsolutePath ( ) ) ; ...
Write the patch . xml
22,060
public CliCommandBuilder setController ( final String hostname , final int port ) { setController ( formatAddress ( null , hostname , port ) ) ; return this ; }
Sets the hostname and port to connect to .
22,061
public CliCommandBuilder setController ( final String protocol , final String hostname , final int port ) { setController ( formatAddress ( protocol , hostname , port ) ) ; return this ; }
Sets the protocol hostname and port to connect to .
22,062
public CliCommandBuilder setTimeout ( final int timeout ) { if ( timeout > 0 ) { addCliArgument ( CliArgument . TIMEOUT , Integer . toString ( timeout ) ) ; } else { addCliArgument ( CliArgument . TIMEOUT , null ) ; } return this ; }
Sets the timeout used when connecting to the server .
22,063
public static < T > ServiceBuilder < T > addServerExecutorDependency ( ServiceBuilder < T > builder , Injector < ExecutorService > injector ) { return builder . addDependency ( ServerService . MANAGEMENT_EXECUTOR , ExecutorService . class , injector ) ; }
Creates dependency on management executor .
22,064
public void handleChannelClosed ( final Channel closed , final IOException e ) { for ( final ActiveOperationImpl < ? , ? > activeOperation : activeRequests . values ( ) ) { if ( activeOperation . getChannel ( ) == closed ) { activeOperation . getResultHandler ( ) . cancel ( ) ; } } }
Receive a notification that the channel was closed .
22,065
public boolean awaitCompletion ( long timeout , TimeUnit unit ) throws InterruptedException { long deadline = unit . toMillis ( timeout ) + System . currentTimeMillis ( ) ; lock . lock ( ) ; try { assert shutdown ; while ( activeCount != 0 ) { long remaining = deadline - System . currentTimeMillis ( ) ; if ( remaining ...
Await the completion of all currently active operations .
22,066
protected < T , A > ActiveOperation < T , A > registerActiveOperation ( final Integer id , A attachment , ActiveOperation . CompletedCallback < T > callback ) { lock . lock ( ) ; try { final Integer operationId ; if ( id == null ) { operationId = operationIdManager . createBatchId ( ) ; } else { if ( ! operationIdManag...
Register an active operation with a specific operation id .
22,067
protected < T , A > ActiveOperation < T , A > getActiveOperation ( final ManagementRequestHeader header ) { return getActiveOperation ( header . getBatchId ( ) ) ; }
Get an active operation .
22,068
protected < T , A > ActiveOperation < T , A > getActiveOperation ( final Integer id ) { return ( ActiveOperation < T , A > ) activeRequests . get ( id ) ; }
Get the active operation .
22,069
protected List < Integer > cancelAllActiveOperations ( ) { final List < Integer > operations = new ArrayList < Integer > ( ) ; for ( final ActiveOperationImpl < ? , ? > activeOperation : activeRequests . values ( ) ) { activeOperation . asyncCancel ( false ) ; operations . add ( activeOperation . getOperationId ( ) ) ;...
Cancel all currently active operations .
22,070
protected < T , A > ActiveOperation < T , A > removeActiveOperation ( Integer id ) { final ActiveOperation < T , A > removed = removeUnderLock ( id ) ; if ( removed != null ) { for ( final Map . Entry < Integer , ActiveRequest < ? , ? > > requestEntry : requests . entrySet ( ) ) { final ActiveRequest < ? , ? > request ...
Remove an active operation .
22,071
protected static void safeWriteErrorResponse ( final Channel channel , final ManagementProtocolHeader header , final Throwable error ) { if ( header . getType ( ) == ManagementProtocol . TYPE_REQUEST ) { try { writeErrorResponse ( channel , ( ManagementRequestHeader ) header , error ) ; } catch ( IOException ioe ) { Pr...
Safe write error response .
22,072
protected static void writeErrorResponse ( final Channel channel , final ManagementRequestHeader header , final Throwable error ) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader . create ( header , error ) ; final MessageOutputStream output = channel . writeMessage ( ) ; try { wr...
Write an error response .
22,073
protected static FlushableDataOutput writeHeader ( final ManagementProtocolHeader header , final OutputStream os ) throws IOException { final FlushableDataOutput output = FlushableDataOutputImpl . create ( os ) ; header . write ( output ) ; return output ; }
Write the management protocol header .
22,074
protected static < T , A > ManagementRequestHandler < T , A > getFallbackHandler ( final ManagementRequestHeader header ) { return new ManagementRequestHandler < T , A > ( ) { public void handleRequest ( final DataInput input , ActiveOperation . ResultHandler < T > resultHandler , ManagementRequestContext < A > context...
Get a fallback handler .
22,075
static void processFile ( final IdentityPatchContext context , final File file , final PatchingTaskContext . Mode mode ) throws IOException { if ( mode == PatchingTaskContext . Mode . APPLY ) { if ( ENABLE_INVALIDATION ) { updateJar ( file , GOOD_ENDSIG_PATTERN , BAD_BYTE_SKIP , CRIPPLED_ENDSIG , GOOD_ENDSIG ) ; backup...
Process a file .
22,076
private static void updateJar ( final File file , final byte [ ] searchPattern , final int [ ] badSkipBytes , final int newSig , final int endSig ) throws IOException { final RandomAccessFile raf = new RandomAccessFile ( file , "rw" ) ; try { final FileChannel channel = raf . getChannel ( ) ; try { long pos = channel ....
Update the central directory signature of a . jar .
22,077
private static boolean validateEndRecord ( File file , FileChannel channel , long startEndRecord , long endSig ) throws IOException { try { channel . position ( startEndRecord ) ; final ByteBuffer endDirHeader = getByteBuffer ( ENDLEN ) ; read ( endDirHeader , channel ) ; if ( endDirHeader . limit ( ) < ENDLEN ) { retu...
Validates that the data structure at position startEndRecord has a field in the expected position that points to the start of the first central directory file and if so that the file has a complete end of central directory record comment at the end .
22,078
private static long scanForEndSig ( final File file , final FileChannel channel , final ScanContext context ) throws IOException { ByteBuffer bb = getByteBuffer ( CHUNK_SIZE ) ; long start = channel . size ( ) ; long end = Math . max ( 0 , start - MAX_REVERSE_SCAN ) ; long channelPos = Math . max ( 0 , start - CHUNK_SI...
Boyer Moore scan that proceeds backwards from the end of the file looking for endsig
22,079
private static long scanForLocSig ( FileChannel channel ) throws IOException { channel . position ( 0 ) ; ByteBuffer bb = getByteBuffer ( CHUNK_SIZE ) ; long end = channel . size ( ) ; while ( channel . position ( ) <= end ) { read ( bb , channel ) ; int bufferPos = 0 ; while ( bufferPos <= bb . limit ( ) - SIG_PATTERN...
Boyer Moore scan that proceeds forwards from the end of the file looking for the first LOCSIG
22,080
private static boolean validateLocalFileRecord ( FileChannel channel , long startLocRecord , long compressedSize ) throws IOException { ByteBuffer lfhBuffer = getByteBuffer ( LOCLEN ) ; read ( lfhBuffer , channel , startLocRecord ) ; if ( lfhBuffer . limit ( ) < LOCLEN || getUnsignedInt ( lfhBuffer , 0 ) != LOCSIG ) { ...
Checks that the data starting at startLocRecord looks like a local file record header .
22,081
private static void computeBadByteSkipArray ( byte [ ] pattern , int [ ] badByteArray ) { for ( int a = 0 ; a < ALPHABET_SIZE ; a ++ ) { badByteArray [ a ] = pattern . length ; } for ( int j = 0 ; j < pattern . length - 1 ; j ++ ) { badByteArray [ pattern [ j ] - Byte . MIN_VALUE ] = pattern . length - j - 1 ; } }
Fills the Boyer Moore bad character array for the given pattern
22,082
public static HostController createHostController ( String jbossHomePath , String modulePath , String [ ] systemPackages , String [ ] cmdargs ) { if ( jbossHomePath == null || jbossHomePath . isEmpty ( ) ) { throw EmbeddedLogger . ROOT_LOGGER . invalidJBossHome ( jbossHomePath ) ; } File jbossHomeDir = new File ( jboss...
Create an embedded host controller .
22,083
public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final ResourceRoot deploymentRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( Attachments . DEPLOYMENT_ROOT ) ; final ModuleSpecification moduleSpecification = phaseContext . getDeploymentUnit ( ) . getAtt...
Add the dependencies if the deployment contains a service activator loader entry .
22,084
public void pause ( ServerActivityCallback requestCountListener ) { if ( paused ) { throw ServerLogger . ROOT_LOGGER . serverAlreadyPaused ( ) ; } this . paused = true ; listenerUpdater . set ( this , requestCountListener ) ; if ( activeRequestCountUpdater . get ( this ) == 0 ) { if ( listenerUpdater . compareAndSet ( ...
Pause the current entry point and invoke the provided listener when all current requests have finished .
22,085
public void resume ( ) { this . paused = false ; ServerActivityCallback listener = listenerUpdater . get ( this ) ; if ( listener != null ) { listenerUpdater . compareAndSet ( this , listener , null ) ; } }
Cancel the pause operation
22,086
public static ModelNode createLocalHostHostInfo ( final LocalHostControllerInfo hostInfo , final ProductConfig productConfig , final IgnoredDomainResourceRegistry ignoredResourceRegistry , final Resource hostModelResource ) { final ModelNode info = new ModelNode ( ) ; info . get ( NAME ) . set ( hostInfo . getLocalHost...
Create the metadata which gets send to the DC when registering .
22,087
public void addModuleDir ( final String moduleDir ) { if ( moduleDir == null ) { throw LauncherMessages . MESSAGES . nullParam ( "moduleDir" ) ; } final Path path = Paths . get ( moduleDir ) . normalize ( ) ; modulesDirs . add ( path . toString ( ) ) ; }
Adds a directory to the collection of module paths .
22,088
public String getModulePaths ( ) { final StringBuilder result = new StringBuilder ( ) ; if ( addDefaultModuleDir ) { result . append ( wildflyHome . resolve ( "modules" ) . toString ( ) ) ; } if ( ! modulesDirs . isEmpty ( ) ) { if ( addDefaultModuleDir ) result . append ( File . pathSeparator ) ; for ( Iterator < Stri...
Returns the modules paths used on the command line .
22,089
public static ModelControllerClient createAndAdd ( final ManagementChannelHandler handler ) { final ExistingChannelModelControllerClient client = new ExistingChannelModelControllerClient ( handler ) ; handler . addHandlerFactory ( client ) ; return client ; }
Create and add model controller handler to an existing management channel handler .
22,090
public static ModelControllerClient createReceiving ( final Channel channel , final ExecutorService executorService ) { final ManagementClientChannelStrategy strategy = ManagementClientChannelStrategy . create ( channel ) ; final ManagementChannelHandler handler = new ManagementChannelHandler ( strategy , executorServi...
Create a model controller client which is exclusively receiving messages on an existing channel .
22,091
protected void addLineContent ( BufferedReader bufferedFileReader , List < String > content , String line ) throws IOException { if ( line . startsWith ( COMMENT_PREFIX ) && line . length ( ) == 1 ) { String nextLine = bufferedFileReader . readLine ( ) ; if ( nextLine != null ) { if ( nextLine . startsWith ( COMMENT_PR...
Remove the realm name block .
22,092
public void validateOperation ( final ModelNode operation ) throws OperationFailedException { if ( operation . hasDefined ( ModelDescriptionConstants . OPERATION_NAME ) && deprecationData != null && deprecationData . isNotificationUseful ( ) ) { ControllerLogger . DEPRECATED_LOGGER . operationDeprecated ( getName ( ) ,...
Validates operation model against the definition and its parameters
22,093
@ SuppressWarnings ( "deprecation" ) public final void validateAndSet ( ModelNode operationObject , final ModelNode model ) throws OperationFailedException { validateOperation ( operationObject ) ; for ( AttributeDefinition ad : this . parameters ) { ad . validateAndSet ( operationObject , model ) ; } }
validates operation against the definition and sets model for the parameters passed .
22,094
< P extends PatchingArtifact . ArtifactState , S extends PatchingArtifact . ArtifactState > PatchingArtifactStateHandler < S > getHandlerForArtifact ( PatchingArtifact < P , S > artifact ) { return handlers . get ( artifact ) ; }
Get a state handler for a given patching artifact .
22,095
public < V > V getAttachment ( final AttachmentKey < V > key ) { assert key != null ; return key . cast ( contextAttachments . get ( key ) ) ; }
Retrieves an object that has been attached to this context .
22,096
public < V > V attach ( final AttachmentKey < V > key , final V value ) { assert key != null ; return key . cast ( contextAttachments . put ( key , value ) ) ; }
Attaches an arbitrary object to this context .
22,097
public < V > V attachIfAbsent ( final AttachmentKey < V > key , final V value ) { assert key != null ; return key . cast ( contextAttachments . putIfAbsent ( key , value ) ) ; }
Attaches an arbitrary object to this context only if the object was not already attached . If a value has already been attached with the key provided the current value associated with the key is returned .
22,098
public < V > V detach ( final AttachmentKey < V > key ) { assert key != null ; return key . cast ( contextAttachments . remove ( key ) ) ; }
Detaches or removes the value from this context .
22,099
private void writeInterfaceCriteria ( final XMLExtendedStreamWriter writer , final ModelNode subModel , final boolean nested ) throws XMLStreamException { for ( final Property property : subModel . asPropertyList ( ) ) { if ( property . getValue ( ) . isDefined ( ) ) { writeInterfaceCriteria ( writer , property , neste...
Write the criteria elements extracting the information of the sub - model .