Package org.jboss.msc.service

Examples of org.jboss.msc.service.ServiceName


    public static synchronized ServiceName registerDeployment(String raName) {
        if (raName == null)
            throw MESSAGES.undefinedVar("RaName");

        Integer identifier = getDeploymentIdentifier(raName);
        ServiceName serviceName = RESOURCE_ADAPTER_DEPLOYMENT_SERVICE_PREFIX.append(raName + "_" + identifier);

        ServiceName entry = deploymentServiceNames.get(raName);

        /*if (entry != null ) {
            deploymentIdentifiers.get(raName).remove(identifier);
            throw MESSAGES.serviceAlreadyRegistered(entry.getCanonicalName());
        } */
 
View Full Code Here


    public static synchronized ServiceName getDeploymentServiceName(String raName) {
            if (raName == null)
                throw MESSAGES.undefinedVar("RaName");

            ServiceName entry = deploymentServiceNames.get(raName);



            return entry;
        }
View Full Code Here

            throw MESSAGES.undefinedVar("RaName");

        if (serviceName == null)
            throw MESSAGES.undefinedVar("ServiceName");

        ServiceName entry = deploymentServiceNames.get(raName);

        if (entry != null) {
            if (!entry.equals(serviceName))
                throw MESSAGES.serviceIsntRegistered(serviceName.getCanonicalName());

            Integer identifier = Integer.valueOf(serviceName.getSimpleName().substring(serviceName.getSimpleName().lastIndexOf("_") + 1));
            deploymentIdentifiers.get(raName).remove(identifier);
View Full Code Here

        Set<ServiceName> serviceNamesForRAActivation = resourceAdapterServiceNames.get(raName);
        if (serviceNamesForRAActivation == null) {
            serviceNamesForRAActivation = new HashSet<ServiceName>();
            resourceAdapterServiceNames.put(raName, serviceNamesForRAActivation);
        }
        final ServiceName serviceName;
        if (serviceNamesForRAActivation.isEmpty()) {
            // this is the first activation, so the service name *won't* have a numeric identifier
            serviceName = RESOURCE_ADAPTER_SERVICE_PREFIX.append(raName);
        } else {
            // there was already an activation for the raName. So generate a service name with a numeric identifier
View Full Code Here

        // check if the ServiceName contains any numeric identifiers, or if it's just the first activation of a RA.
        // if the service name has a numeric part, then we need to get that numeric part and unregister that number
        // from the map which hold the in-use numeric ids.
        // @see registerResourceAdapter method for more details on how the service names are generated
        if (!serviceName.equals(RESOURCE_ADAPTER_SERVICE_PREFIX.append(raName))) {
            final ServiceName baseServiceName = RESOURCE_ADAPTER_SERVICE_PREFIX.append(raName).append(RA_SERVICE_NAME_SEPARATOR);
            // if the service name doesn't start with the RESOURCE_ADAPTER_SERVICE_PREFIX.append(raName).append(RA_SERVICE_NAME_SEPARATOR)
            // format, then it isn't a RA service
            if (!baseServiceName.isParentOf(serviceName)) {
                throw MESSAGES.notResourceAdapterService(serviceName);
            }
            // get the service name parts
            final String[] parts = serviceName.toArray();
            // get the numerical id which will be the last part of the service name
View Full Code Here

    protected final void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();
        // Make sure the handler isn't attached
        checkHandler(context, name);
        final ServiceName serviceName = LogServices.handlerName(name);
        final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
        @SuppressWarnings("unchecked")
        final ServiceController<Handler> controller = (ServiceController<Handler>) serviceRegistry.getService(serviceName);
        controller.getValue().close();
        context.removeService(serviceName);
View Full Code Here

        value = new ResourceAdapterDeployment(deploymentMD);
        registry.getValue().registerResourceAdapterDeployment(value);
        managementRepository.getValue().getConnectors().add(value.getDeployment().getConnector());

        String raName = value.getDeployment().getDeploymentName();
        ServiceName raServiceName = ConnectorServices.registerResourceAdapter(raName);

        context.getChildTarget()
                .addService(raServiceName,
                    new ResourceAdapterService(raName, raServiceName,
                                               value.getDeployment().getResourceAdapter())).setInitialMode(Mode.ACTIVE)
View Full Code Here

    static void addFile(final OperationContext context, final ServiceBuilder<Handler> serviceBuilder, final AbstractFileHandlerService service, final ModelNode file, final String name) throws OperationFailedException {
        if (file.isDefined()) {
            final ModelNode path = PATH.resolveModelAttribute(context, file);
            final ModelNode relativeTo = RELATIVE_TO.resolveModelAttribute(context, file);
            final ServiceName serviceName = LogServices.handlerFileName(name);

            // Retrieve the current service
            final ServiceTarget serviceTarget = context.getServiceTarget();
            final HandlerFileService fileService = new HandlerFileService(path.asString());
            final ServiceBuilder<?> fileBuilder = serviceTarget.addService(serviceName, fileService);
View Full Code Here

            final ModelNode currentRelativeTo = RELATIVE_TO.resolveModelAttribute(context, oldFile);
            // If relative-to is defined, no need to continue.
            if (relativeTo.isDefined() && !currentRelativeTo.equals(relativeTo) && !AbstractPathService.isAbsoluteUnixOrWindowsPath(path.asString())) {
                requiresRestart = true;
            } else {
                final ServiceName serviceName = LogServices.handlerFileName(name);

                // Retrieve the current service
                final ServiceRegistry registry = context.getServiceRegistry(true);
                final ServiceController<?> fileController = registry.getService(serviceName);
                if (fileController == null) {
View Full Code Here

    }

    static void revertFileChange(final OperationContext context, final ModelNode file, final String name) throws OperationFailedException {
        if (file.isDefined()) {
            final ModelNode path = PATH.resolveModelAttribute(context, file);
            final ServiceName serviceName = LogServices.handlerFileName(name);

            // Retrieve the current service
            final ServiceRegistry registry = context.getServiceRegistry(true);
            final ServiceController<?> fileController = registry.getService(serviceName);
            if (fileController == null) {
View Full Code Here

TOP

Related Classes of org.jboss.msc.service.ServiceName

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.