Package org.jboss.as.model

Examples of org.jboss.as.model.ServerModel


        log.infof("Started %s for directory %s", getClass().getSimpleName(), deploymentDir.getAbsolutePath());
    }

    private void establishDeployedContentList(File dir) {
        ServerModel serverModel = this.serverModel;
        File[] children = dir.listFiles();
        for (File child : children) {
            String fileName = child.getName();
            if (child.isDirectory()) {
                // TODO special handling for exploded content
                establishDeployedContentList(child);
            }
            else if (fileName.endsWith(DEPLOYED)) {
                String deploymentName = fileName.substring(0, fileName.length() - DEPLOYED.length());
                if (serverModel.getDeployment(deploymentName) != null) {
                    // ServerModel knows about this deployment
                    deployed.add(deploymentName);
                }
                else {
                    // ServerModel doesn't know about this deployment, so the
View Full Code Here


            super.readRequest(input);
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            ServerModel sm = serverController.getValue().getServerModel();

            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(DomainServerProtocol.RETURN_SERVER_MODEL);
            marshaller.writeObject(sm);
View Full Code Here

        }

        // Next-stage services

        // Initial model
        final ServerModel serverModel = new ServerModel(serverName, portOffset);

        final Properties systemProperties = System.getProperties();
        final ServerEnvironment environment = providedEnvironment != null
                        ? providedEnvironment
                        : new ServerEnvironment(systemProperties, serverName, false);

        log.info("Activating core services");

        // The server controller
        // TODO make ServerConfigurationPersister internal
        // TODO share thread pool
        ServerControllerImpl serverController = new ServerControllerImpl(serverModel, container, environment.isStandalone());
        batchBuilder.addService(ServerController.SERVICE_NAME, serverController)
            .addDependency(ServerConfigurationPersister.SERVICE_NAME, ServerConfigurationPersister.class, serverController.getConfigurationPersisterValue())
            .addInjection(serverController.getExecutorValue(), Executors.newCachedThreadPool());

        // Server environment services
        ServerEnvironmentServices.addServices(environment, batchBuilder);

        // Deployment repository
        ServerDeploymentRepositoryImpl.addService(batchBuilder);

        // Graceful shutdown
        ShutdownHandlerImpl.addService(batchBuilder);

        // Server model service - TODO: replace with ServerController
        ServerModelService.addService(serverModel, batchBuilder);

        // Server deployment manager - TODO: move into startServices, only start in standalone mode
        ServerDeploymentManagerImpl.addService(serverModel, container, batchBuilder);

        // Server configuration persister - TODO: move into startServices, only start in standalone mode
        ServerConfigurationPersisterImpl.addService(serverModel, batchBuilder);

        // Server deployment scanner factory
        DeploymentScannerFactoryService.addService(batchBuilder);

        batchBuilder.addService(SocketBindingManager.SOCKET_BINDING_MANAGER,
                new SocketBindingManagerService(portOffset)).setInitialMode(ServiceController.Mode.ON_DEMAND);

        // Activate deployment module loader
        batchBuilder.addService(ClassifyingModuleLoaderService.SERVICE_NAME, new ClassifyingModuleLoaderService());

        final DeploymentModuleLoaderService deploymentModuleLoaderService = new DeploymentModuleLoaderService(new DeploymentModuleLoaderImpl());
        batchBuilder.addService(DeploymentModuleLoaderService.SERVICE_NAME, deploymentModuleLoaderService)
            .addDependency(ClassifyingModuleLoaderService.SERVICE_NAME, ClassifyingModuleLoaderService.class, new ClassifyingModuleLoaderInjector("deployment", deploymentModuleLoaderService));

        // todo move elsewhere...
        new JarDeploymentActivator().activate(new ServiceActivatorContext() {
            public BatchBuilder getBatchBuilder() {
                return batchBuilder;
            }
        });

        for (AbstractServerModelUpdate<?> update : updates) {
            try {
                serverModel.update(update);
            } catch (UpdateFailedException e) {
                throw new IllegalStateException("Failed to start server", e);
            }
        }
View Full Code Here

        @Override
        protected final ServerModel receiveResponse(final InputStream input) throws IOException {
            final Unmarshaller unmarshaller = getUnmarshaller();
            unmarshaller.start(createByteInput(input));
            expectHeader(unmarshaller, DomainServerProtocol.RETURN_SERVER_MODEL);
            ServerModel serverModel = unmarshal(unmarshaller, ServerModel.class);
            unmarshaller.finish();
            return serverModel;
        }
View Full Code Here

            unmarshaller.finish();
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            ServerModel serverModel = serverManager.getServerModel(serverName);
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(ServerManagerProtocol.RETURN_SERVER_MODEL);
            marshaller.writeObject(serverModel);
            marshaller.finish();
View Full Code Here

        @Override
        protected ServerModel receiveResponse(InputStream input) throws IOException {
            final Unmarshaller unmarshaller = getUnmarshaller();
            unmarshaller.start(createByteInput(input));
            expectHeader(unmarshaller, StandaloneClientProtocol.PARAM_SERVER_MODEL);
            final ServerModel serverModel = unmarshal(unmarshaller, ServerModel.class);
            unmarshaller.finish();
            return serverModel;
        }
View Full Code Here

            unmarshaller.finish();
        }

        @Override
        protected void sendResponse(final OutputStream outputStream) throws IOException {
            ServerModel serverModel = domainController.getServerModel(serverManagerName, serverName);
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(outputStream));
            marshaller.writeByte(DomainClientProtocol.RETURN_SERVER_MODEL);
            marshaller.writeObject(serverModel);
            marshaller.finish();
View Full Code Here

        @Override
        protected ServerModel receiveResponse(final InputStream input) throws IOException {
            final Unmarshaller unmarshaller = getUnmarshaller();
            unmarshaller.start(createByteInput(input));
            ProtocolUtils.expectHeader(unmarshaller, ServerManagerProtocol.RETURN_SERVER_MODEL);
            final ServerModel response = unmarshal(unmarshaller, ServerModel.class);
            unmarshaller.finish();
            return response;
        }
View Full Code Here

        @Override
        protected final ServerModel receiveResponse(final InputStream input) throws IOException {
            final Unmarshaller unmarshaller = getUnmarshaller();
            unmarshaller.start(createByteInput(input));
            expectHeader(unmarshaller, DomainClientProtocol.RETURN_SERVER_MODEL);
            final ServerModel serverModel = unmarshal(unmarshaller, ServerModel.class);
            unmarshaller.finish();
            return serverModel;
        }
View Full Code Here

TOP

Related Classes of org.jboss.as.model.ServerModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.