@Override public ProtocolConnectionManager.ConnectTask connectionClosed() { ServerLogger.AS_ROOT_LOGGER.debugf("Connection to Host Controller closed"); return this; }
@Override public ProtocolConnectionManager.ConnectTask connectionClosed() { ServerLogger.AS_ROOT_LOGGER.debugf("Connection to Host Controller closed"); return this; }
private static AbstractVaultReader loadVaultReaderService() { final ServiceLoader<AbstractVaultReader> serviceLoader = ServiceLoader.load(AbstractVaultReader.class, ApplicationServerService.class.getClassLoader()); final Iterator<AbstractVaultReader> it = serviceLoader.iterator(); // TODO WFCORE-114 get rid of catching/suppressing errors once we have a complete impl in WFCORE ServiceConfigurationError sce = null; try { while (it.hasNext()) { return it.next(); } } catch (ServiceConfigurationError e) { sce = e; } if (sce != null) { ServerLogger.AS_ROOT_LOGGER.debugf(sce, "Cannot instantiate provider of service %s", AbstractVaultReader.class); } return null; } }
private static AbstractVaultReader loadVaultReaderService() { final ServiceLoader<AbstractVaultReader> serviceLoader = ServiceLoader.load(AbstractVaultReader.class, ApplicationServerService.class.getClassLoader()); final Iterator<AbstractVaultReader> it = serviceLoader.iterator(); // TODO WFCORE-114 get rid of catching/suppressing errors once we have a complete impl in WFCORE ServiceConfigurationError sce = null; try { while (it.hasNext()) { return it.next(); } } catch (ServiceConfigurationError e) { sce = e; } if (sce != null) { ServerLogger.AS_ROOT_LOGGER.debugf(sce, "Cannot instantiate provider of service %s", AbstractVaultReader.class); } return null; } }
@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()); }
@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); deploymentMountProviderConsumer.accept(this); } catch (IOException e) { throw ServerLogger.ROOT_LOGGER.failedCreatingTempProvider(e); } ServerLogger.ROOT_LOGGER.debugf("%s started", DeploymentMountProvider.class.getSimpleName()); }
@Override public void run() { try { VFSUtils.safeClose(tempFileProvider); } finally { try { ScheduledExecutorService ses = scheduledExecutorService; scheduledExecutorService = null; if (ses != null) { ses.shutdown(); } ServerLogger.ROOT_LOGGER.debugf("%s stopped", DeploymentMountProvider.class.getSimpleName()); } finally { context.complete(); } } } };
@Override public void run() { try { deploymentMountProviderConsumer.accept(null); VFSUtils.safeClose(tempFileProvider); } finally { try { ScheduledExecutorService ses = scheduledExecutorService; scheduledExecutorService = null; if (ses != null) { ses.shutdown(); } ServerLogger.ROOT_LOGGER.debugf("%s stopped", DeploymentMountProvider.class.getSimpleName()); } finally { context.complete(); } } } };
private void handlingExistingClassPathEntry(final ArrayDeque<RootEntry> resourceRoots, final DeploymentUnit topLevelDeployment, final VirtualFile topLevelRoot, final Map<VirtualFile, ResourceRoot> subDeployments, final Map<VirtualFile, AdditionalModuleSpecification> additionalModules, final Set<VirtualFile> existingAccessibleRoots, final ResourceRoot resourceRoot, final Attachable target, final VirtualFile classPathFile) throws DeploymentUnitProcessingException { if (existingAccessibleRoots.contains(classPathFile)) { ServerLogger.DEPLOYMENT_LOGGER.debugf("Class-Path entry %s in %s ignored, as target is already accessible", classPathFile, resourceRoot.getRoot()); } else if (additionalModules.containsKey(classPathFile)) { final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile); //as class path entries are exported, transitive dependencies will also be available target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier()); } else if (subDeployments.containsKey(classPathFile)) { //now we need to calculate the sub deployment module identifier //unfortunately the sub deployment has not been setup yet, so we cannot just //get it from the sub deployment directly final ResourceRoot otherRoot = subDeployments.get(classPathFile); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false)); } else { ModuleIdentifier identifier = createAdditionalModule(resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, identifier); } }
private void handlingExistingClassPathEntry(final ArrayDeque<RootEntry> resourceRoots, final DeploymentUnit topLevelDeployment, final VirtualFile topLevelRoot, final Map<VirtualFile, ResourceRoot> subDeployments, final Map<VirtualFile, AdditionalModuleSpecification> additionalModules, final Set<VirtualFile> existingAccessibleRoots, final ResourceRoot resourceRoot, final Attachable target, final VirtualFile classPathFile) throws DeploymentUnitProcessingException { if (existingAccessibleRoots.contains(classPathFile)) { ServerLogger.DEPLOYMENT_LOGGER.debugf("Class-Path entry %s in %s ignored, as target is already accessible", classPathFile, resourceRoot.getRoot()); } else if (additionalModules.containsKey(classPathFile)) { final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile); //as class path entries are exported, transitive dependencies will also be available target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier()); } else if (subDeployments.containsKey(classPathFile)) { //now we need to calculate the sub deployment module identifier //unfortunately the sub deployment has not been setup yet, so we cannot just //get it from the sub deployment directly final ResourceRoot otherRoot = subDeployments.get(classPathFile); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false)); } else { ModuleIdentifier identifier = createAdditionalModule(resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, identifier); } }
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); }
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); }
/** * Send the started notification */ synchronized void started() { try { if(isConnected()) { channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await(); } } catch (Exception e) { ServerLogger.AS_ROOT_LOGGER.debugf(e, "failed to send started notification"); } }
/** * Send the started notification */ synchronized void started() { try { if(isConnected()) { channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await(); } } catch (Exception e) { ServerLogger.AS_ROOT_LOGGER.debugf(e, "failed to send started notification"); } }
/** * We are adding a redeploy operation step for each specified deployment runtime name. * * @param context * @param deploymentsRootAddress * @param deploymentNames * @throws OperationFailedException */ public static void redeployDeployments(OperationContext context, PathAddress deploymentsRootAddress, Set<String> deploymentNames) throws OperationFailedException { for (String deploymentName : deploymentNames) { PathAddress address = deploymentsRootAddress.append(DEPLOYMENT, deploymentName); OperationStepHandler handler = context.getRootResourceRegistration().getOperationHandler(address, REDEPLOY); ModelNode operation = addRedeployStep(address); ServerLogger.AS_ROOT_LOGGER.debugf("Redeploying %s at address %s with handler %s", deploymentName, address, handler); assert handler != null; assert operation.isDefined(); context.addStep(operation, handler, OperationContext.Stage.MODEL); } }
/** * We are adding a redeploy operation step for each specified deployment runtime name. * * @param context * @param deploymentsRootAddress * @param deploymentNames * @throws OperationFailedException */ public static void redeployDeployments(OperationContext context, PathAddress deploymentsRootAddress, Set<String> deploymentNames) throws OperationFailedException { for (String deploymentName : deploymentNames) { PathAddress address = deploymentsRootAddress.append(DEPLOYMENT, deploymentName); OperationStepHandler handler = context.getRootResourceRegistration().getOperationHandler(address, REDEPLOY); ModelNode operation = addRedeployStep(address); ServerLogger.AS_ROOT_LOGGER.debugf("Redeploying %s at address %s with handler %s", deploymentName, address, handler); assert handler != null; assert operation.isDefined(); context.addStep(operation, handler, OperationContext.Stage.MODEL); } }
private boolean validOverlay(PathAddress operationAddress) { if (operationAddress.size() >= 1 && operationAddress.size() >= overlayAddress.size()) { ServerLogger.AS_ROOT_LOGGER.debugf("Comparing address %s with %s", operationAddress.subAddress(0, overlayAddress.size()).toCLIStyleString(), overlayAddress.toCLIStyleString()); return operationAddress.subAddress(0, overlayAddress.size()).equals(overlayAddress); } return false; } }
/** * We are adding a redeploy operation step for each specified deployment runtime name. * * @param context * @param deploymentsRootAddress * @param runtimeNames * @throws OperationFailedException */ public static void redeployLinks(OperationContext context, PathAddress deploymentsRootAddress, Set<String> runtimeNames) throws OperationFailedException { Set<String> deploymentNames = listDeployments(context.readResourceFromRoot(deploymentsRootAddress), runtimeNames); for (String deploymentName : deploymentNames) { PathAddress address = deploymentsRootAddress.append(DEPLOYMENT, deploymentName); OperationStepHandler handler = context.getRootResourceRegistration().getOperationHandler(address, REDEPLOY); ModelNode operation = addRedeployStep(address); ServerLogger.AS_ROOT_LOGGER.debugf("Redeploying %s at address %s with handler %s", deploymentName, address, handler); assert handler != null; assert operation.isDefined(); context.addStep(operation, handler, OperationContext.Stage.MODEL); } }
/** * We are adding a redeploy operation step for each specified deployment runtime name. * * @param context * @param deploymentsRootAddress * @param runtimeNames * @throws OperationFailedException */ public static void redeployLinks(OperationContext context, PathAddress deploymentsRootAddress, Set<String> runtimeNames) throws OperationFailedException { Set<String> deploymentNames = listDeployments(context.readResourceFromRoot(deploymentsRootAddress), runtimeNames); for (String deploymentName : deploymentNames) { PathAddress address = deploymentsRootAddress.append(DEPLOYMENT, deploymentName); OperationStepHandler handler = context.getRootResourceRegistration().getOperationHandler(address, REDEPLOY); ModelNode operation = addRedeployStep(address); ServerLogger.AS_ROOT_LOGGER.debugf("Redeploying %s at address %s with handler %s", deploymentName, address, handler); assert handler != null; assert operation.isDefined(); context.addStep(operation, handler, OperationContext.Stage.MODEL); } }
private boolean validOverlay(PathAddress operationAddress) { if (operationAddress.size() >= 1 && operationAddress.size() >= overlayAddress.size()) { ServerLogger.AS_ROOT_LOGGER.debugf("Comparing address %s with %s", operationAddress.subAddress(0, overlayAddress.size()).toCLIStyleString(), overlayAddress.toCLIStyleString()); return operationAddress.subAddress(0, overlayAddress.size()).equals(overlayAddress); } return false; } }