private static XMLStreamException endOfDocument(final Location location) { return ServerLogger.ROOT_LOGGER.unexpectedEndOfDocument(location); } }
private SingletonDeploymentConfiguration parse(DeploymentUnit unit, File file) throws DeploymentUnitProcessingException { try (BufferedReader reader = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) { XMLStreamReader xmlReader = XML_INPUT_FACTORY.createXMLStreamReader(reader); try { MutableSingletonDeploymentConfiguration config = new MutableSingletonDeploymentConfiguration(unit); this.mapper.parseDocument(config, xmlReader); return config; } finally { xmlReader.close(); } } catch (XMLStreamException e) { throw ServerLogger.ROOT_LOGGER.errorLoadingDeploymentStructureFile(file.getPath(), e); } catch (FileNotFoundException e) { throw ServerLogger.ROOT_LOGGER.deploymentStructureFileNotFound(file); } catch (IOException e) { throw ServerLogger.ROOT_LOGGER.deploymentStructureFileNotFound(file); } } }
throw ServerLogger.ROOT_LOGGER.hostControllerNameNonNullInStandalone(); throw ServerLogger.ROOT_LOGGER.hostControllerNameNullInDomain(); throw ServerLogger.ROOT_LOGGER.requiredSystemPropertyMissing(SERVER_TEMP_DIR); throw ServerLogger.ROOT_LOGGER.missingHomeDirConfiguration(HOME_DIR); throw ServerLogger.ROOT_LOGGER.homeDirectoryDoesNotExist(homeDir); throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryDoesNotExist(tmp); } else if (!tmp.isDirectory()) { throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryIsNotADirectory(tmp); throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryIsNotADirectory(tmp); throw ServerLogger.ROOT_LOGGER.couldNotCreateServerBaseDirectory(tmp); Path resolved = tmp.toPath().toRealPath(); if (!tmp.toPath().equals(resolved)){ //WFCORE-2652 ServerLogger.ROOT_LOGGER.serverHomeMismatch(tmp.toPath(), resolved); tmp = resolved.toFile(); throw ServerLogger.ROOT_LOGGER.configDirectoryDoesNotExist(serverConfigurationDir); if (serverDataDir.exists()) { if (!serverDataDir.isDirectory()) { throw ServerLogger.ROOT_LOGGER.serverDataDirectoryIsNotDirectory(serverDataDir);
final ProductConfig config = serverEnvironment.getProductConfig(); final String prettyVersion = config.getPrettyVersionString(); ServerLogger.AS_ROOT_LOGGER.serverStarting(prettyVersion); if (System.getSecurityManager() != null) { ServerLogger.AS_ROOT_LOGGER.securityManagerEnabled(); if (ServerLogger.CONFIG_LOGGER.isDebugEnabled()) { final Properties properties = System.getProperties(); final StringBuilder b = new StringBuilder(8192); b.append(ServerLogger.ROOT_LOGGER.configuredSystemPropertiesLabel()); for (String property : new TreeSet<String>(properties.stringPropertyNames())) { String propVal = property.toLowerCase(Locale.getDefault()).contains("password") ? "<redacted>" : properties.getProperty(property, "<undefined>"); b.append("\n\t").append(property).append(" = ").append(propVal); ServerLogger.CONFIG_LOGGER.debug(b); ServerLogger.CONFIG_LOGGER.debugf(ServerLogger.ROOT_LOGGER.vmArgumentsLabel(getVMArguments())); if (ServerLogger.CONFIG_LOGGER.isTraceEnabled()) { b.setLength(0); final Map<String,String> env = System.getenv(); b.append(ServerLogger.ROOT_LOGGER.configuredSystemEnvironmentLabel()); for (String key : new TreeSet<String>(env.keySet())) { String envVal = key.toLowerCase(Locale.getDefault()).contains("password") ? "<redacted>" : env.get(key); b.append("\n\t").append(key).append(" = ").append(envVal); ServerLogger.CONFIG_LOGGER.trace(b); ServerLogger.AS_ROOT_LOGGER.debugf("Using VaultReader %s", vaultReader); ServerService.addService(serviceTarget, configuration, processState, bootstrapListener, runningModeControl, vaultReader, configuration.getAuditLogger(), configuration.getAuthorizer(), configuration.getSecurityIdentitySupplier(), suspendController);
ServerLogger.AS_ROOT_LOGGER.serverStarting(prettyVersion); if (System.getSecurityManager() != null) { ServerLogger.AS_ROOT_LOGGER.securityManagerEnabled(); if (ServerLogger.CONFIG_LOGGER.isDebugEnabled()) { final Properties properties = System.getProperties(); final StringBuilder b = new StringBuilder(8192); b.append("\n\t").append(property).append(" = ").append(propVal); ServerLogger.CONFIG_LOGGER.debug(b); ServerLogger.CONFIG_LOGGER.debugf("VM Arguments: %s", getVMArguments()); if (ServerLogger.CONFIG_LOGGER.isTraceEnabled()) { b.setLength(0); final Map<String, String> env = System.getenv(); b.append("\n\t").append(key).append(" = ").append(envVal); ServerLogger.CONFIG_LOGGER.trace(b);
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { long start = System.currentTimeMillis(); final ModelNode address = new ModelNode().setEmptyList(); if (Element.forName(reader.getLocalName()) != Element.SERVER) { throw unexpectedElement(reader); } boolean validNamespace = false; for (Namespace current : Namespace.domainValues()) { if (namespace.equals(current)) { validNamespace = true; readServerElement(reader, address, operationList); break; } } if (validNamespace == false) { throw unexpectedElement(reader); } if (ServerLogger.ROOT_LOGGER.isDebugEnabled()) { long elapsed = System.currentTimeMillis() - start; ServerLogger.ROOT_LOGGER.debugf("Parsed standalone configuration in [%d] ms", elapsed); } }
@Override public ProtocolConnectionManager.ConnectTask connectionClosed() { ServerLogger.AS_ROOT_LOGGER.debugf("Connection to Host Controller closed"); return this; }
return ServerLogger.ROOT_LOGGER.unexpectedContent(kind, (reader.hasName() ? reader.getName() : null), (reader.hasText() ? reader.getText() : null), reader.getLocation());
public synchronized void start(StartContext arg0) throws StartException { log.debug("Starting NetworkInterfaceService\n"); try { this.interfaceBinding = createBinding(anyLocal, criteria); } catch (Exception e) { throw new StartException(e); } if (this.interfaceBinding == null) { throw ServerLogger.ROOT_LOGGER.failedToResolveInterface(name); } log.debugf("NetworkInterfaceService matched interface binding: %s\n", interfaceBinding); }
@Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { try { ServerLogger.ROOT_LOGGER.deletingFile(file); Files.delete(file); } catch (IOException ioex) { ServerLogger.ROOT_LOGGER.debug(ioex.getMessage(), ioex); } return FileVisitResult.CONTINUE; }
/** * Setup clean directories to run the container. * @param cleanServerBaseDirPath the clean server base directory */ private static void setupCleanServerDirectories(final StandaloneCommandBuilder commandBuilder, final String cleanServerBaseDirPath) throws IOException { final Path cleanBase; if (cleanServerBaseDirPath != null) { cleanBase = Paths.get(cleanServerBaseDirPath); } else { cleanBase = Files.createTempDirectory(TEMP_CONTAINER_DIRECTORY); } if (Files.notExists(cleanBase)) { throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryDoesNotExist(cleanBase.toFile()); } if (!Files.isDirectory(cleanBase)) { throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryIsNotADirectory(cleanBase.toFile()); } final Path currentConfigDir = commandBuilder.getConfigurationDirectory(); final Path configDir = cleanBase.resolve(CONFIG_DIR); copyDir(currentConfigDir, configDir); final Path currentDataDir = commandBuilder.getBaseDirectory().resolve(DATA_DIR); if (Files.exists(currentDataDir)) { copyDir(currentDataDir, cleanBase.resolve(DATA_DIR)); } commandBuilder.setBaseDirectory(cleanBase); commandBuilder.setConfigurationDirectory(configDir); }
final String extensionName = mainAttributes.getValue(item + "-" + EXTENSION_NAME); if (extensionName == null) { ServerLogger.DEPLOYMENT_LOGGER.extensionMissingManifestAttribute(item, item, EXTENSION_NAME); continue; URI implementationUri = null; if (implementationUrl == null) { ServerLogger.DEPLOYMENT_LOGGER.debugf("Extension %s is missing the required manifest attribute %s-%s", item, item, IMPLEMENTATION_URL); } else { try { implementationUri = new URI(implementationUrl); } catch (URISyntaxException e) { ServerLogger.DEPLOYMENT_LOGGER.invalidExtensionURI(item, e);
private ParseResult parse(final File file, final DeploymentUnit deploymentUnit, final ModuleLoader moduleLoader) throws DeploymentUnitProcessingException { final FileInputStream fis; try { fis = new FileInputStream(file); } catch (FileNotFoundException e) { throw ServerLogger.ROOT_LOGGER.deploymentStructureFileNotFound(file); } try { return parse(fis, file, deploymentUnit, moduleLoader); } finally { safeClose(fis); } }
@Override public void start(StartContext context) throws StartException { try { final JBossThreadFactory threadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(new ThreadGroup("ServerDeploymentRepository-temp-threads"), true, null, "%G - %t", null, null); } }); scheduledExecutorService = Executors.newScheduledThreadPool(2, threadFactory); tempFileProvider = TempFileProvider.create("temp", scheduledExecutorService, true); } catch (IOException e) { throw ServerLogger.ROOT_LOGGER.failedCreatingTempProvider(e); } ServerLogger.ROOT_LOGGER.debugf("%s started", DeploymentMountProvider.class.getSimpleName()); }
private ParseResult parse(final InputStream source, final File file, final DeploymentUnit deploymentUnit, final ModuleLoader moduleLoader) throws DeploymentUnitProcessingException { try { final XMLInputFactory inputFactory = INPUT_FACTORY; setIfSupported(inputFactory, XMLInputFactory.IS_VALIDATING, Boolean.FALSE); setIfSupported(inputFactory, XMLInputFactory.SUPPORT_DTD, Boolean.FALSE); final XMLStreamReader streamReader = inputFactory.createXMLStreamReader(source); try { final ParseResult result = new ParseResult(moduleLoader, deploymentUnit); mapper.parseDocument(result, streamReader); return result; } finally { safeClose(streamReader); } } catch (XMLStreamException e) { throw ServerLogger.ROOT_LOGGER.errorLoadingDeploymentStructureFile(file.getPath(), e); } }
public void awaitSuspend() { synchronized (lock) { while (suspend && shuttingDown) { try { lock.wait(); } catch (InterruptedException e) { ServerLogger.AS_ROOT_LOGGER.debug("Exception waiting for graceful shutdown", e); } } } }
throw ServerLogger.ROOT_LOGGER.hostControllerNameNonNullInStandalone(); throw ServerLogger.ROOT_LOGGER.hostControllerNameNullInDomain(); throw ServerLogger.ROOT_LOGGER.requiredSystemPropertyMissing(SERVER_TEMP_DIR); throw ServerLogger.ROOT_LOGGER.missingHomeDirConfiguration(HOME_DIR); throw ServerLogger.ROOT_LOGGER.homeDirectoryDoesNotExist(homeDir); throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryDoesNotExist(tmp); } else if (!tmp.isDirectory()) { throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryIsNotADirectory(tmp); throw ServerLogger.ROOT_LOGGER.serverBaseDirectoryIsNotADirectory(tmp); throw ServerLogger.ROOT_LOGGER.couldNotCreateServerBaseDirectory(tmp); Path resolved = tmp.toPath().toRealPath(); if (!tmp.toPath().equals(resolved)){ //WFCORE-2652 ServerLogger.ROOT_LOGGER.serverHomeMismatch(tmp.toPath(), resolved); tmp = resolved.toFile(); throw ServerLogger.ROOT_LOGGER.configDirectoryDoesNotExist(serverConfigurationDir); if (serverDataDir.exists()) { if (!serverDataDir.isDirectory()) { throw ServerLogger.ROOT_LOGGER.serverDataDirectoryIsNotDirectory(serverDataDir);
final ProductConfig config = serverEnvironment.getProductConfig(); final String prettyVersion = config.getPrettyVersionString(); ServerLogger.AS_ROOT_LOGGER.serverStarting(prettyVersion); if (System.getSecurityManager() != null) { ServerLogger.AS_ROOT_LOGGER.securityManagerEnabled(); if (ServerLogger.CONFIG_LOGGER.isDebugEnabled()) { final Properties properties = System.getProperties(); final StringBuilder b = new StringBuilder(8192); b.append(ServerLogger.ROOT_LOGGER.configuredSystemPropertiesLabel()); for (String property : new TreeSet<String>(properties.stringPropertyNames())) { String propVal = property.toLowerCase(Locale.getDefault()).contains("password") ? "<redacted>" : properties.getProperty(property, "<undefined>"); b.append("\n\t").append(property).append(" = ").append(propVal); ServerLogger.CONFIG_LOGGER.debug(b); ServerLogger.CONFIG_LOGGER.debugf(ServerLogger.ROOT_LOGGER.vmArgumentsLabel(getVMArguments())); if (ServerLogger.CONFIG_LOGGER.isTraceEnabled()) { b.setLength(0); final Map<String,String> env = System.getenv(); b.append(ServerLogger.ROOT_LOGGER.configuredSystemEnvironmentLabel()); for (String key : new TreeSet<String>(env.keySet())) { String envVal = key.toLowerCase(Locale.getDefault()).contains("password") ? "<redacted>" : env.get(key); b.append("\n\t").append(key).append(" = ").append(envVal); ServerLogger.CONFIG_LOGGER.trace(b); ServerLogger.AS_ROOT_LOGGER.debugf("Using VaultReader %s", vaultReader); ServerService.addService(serviceTarget, configuration, processState, bootstrapListener, runningModeControl, vaultReader, configuration.getAuditLogger(), configuration.getAuthorizer(), configuration.getSecurityIdentitySupplier(), suspendController);
ServerLogger.AS_ROOT_LOGGER.serverStarting(prettyVersion); if (System.getSecurityManager() != null) { ServerLogger.AS_ROOT_LOGGER.securityManagerEnabled(); if (ServerLogger.CONFIG_LOGGER.isDebugEnabled()) { final Properties properties = System.getProperties(); final StringBuilder b = new StringBuilder(8192); b.append("\n\t").append(property).append(" = ").append(propVal); ServerLogger.CONFIG_LOGGER.debug(b); ServerLogger.CONFIG_LOGGER.debugf("VM Arguments: %s", getVMArguments()); if (ServerLogger.CONFIG_LOGGER.isTraceEnabled()) { b.setLength(0); final Map<String, String> env = System.getenv(); b.append("\n\t").append(key).append(" = ").append(envVal); ServerLogger.CONFIG_LOGGER.trace(b);
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { long start = System.currentTimeMillis(); final ModelNode address = new ModelNode().setEmptyList(); if (Element.forName(reader.getLocalName()) != Element.SERVER) { throw unexpectedElement(reader); } boolean validNamespace = false; for (Namespace current : Namespace.domainValues()) { if (namespace.equals(current)) { validNamespace = true; readServerElement(reader, address, operationList); break; } } if (validNamespace == false) { throw unexpectedElement(reader); } if (ServerLogger.ROOT_LOGGER.isDebugEnabled()) { long elapsed = System.currentTimeMillis() - start; ServerLogger.ROOT_LOGGER.debugf("Parsed standalone configuration in [%d] ms", elapsed); } }