Search in sources :

Example 1 with ServiceBasedNamingStore

use of org.jboss.as.naming.ServiceBasedNamingStore in project wildfly by wildfly.

the class BinderService method stop.

/**
     * Unbind the entry from the injected context.
     *
     * @param context The stop context
     */
public void stop(StopContext context) {
    final ServiceBasedNamingStore namingStore = namingStoreValue.getValue();
    namingStore.remove(controller.getName());
    ROOT_LOGGER.tracef("Unbound resource %s into naming store %s (service name %s)", name, namingStore, context.getController().getName());
}
Also used : ServiceBasedNamingStore(org.jboss.as.naming.ServiceBasedNamingStore)

Example 2 with ServiceBasedNamingStore

use of org.jboss.as.naming.ServiceBasedNamingStore in project wildfly by wildfly.

the class BinderService method start.

/**
     * Bind the entry into the injected context.
     *
     * @param context The start context
     * @throws StartException If the entity can not be bound
     */
public void start(StartContext context) throws StartException {
    final ServiceBasedNamingStore namingStore = namingStoreValue.getValue();
    controller = context.getController();
    namingStore.add(controller.getName());
    ROOT_LOGGER.tracef("Bound resource %s into naming store %s (service name %s)", name, namingStore, controller.getName());
}
Also used : ServiceBasedNamingStore(org.jboss.as.naming.ServiceBasedNamingStore)

Example 3 with ServiceBasedNamingStore

use of org.jboss.as.naming.ServiceBasedNamingStore in project wildfly by wildfly.

the class NamingStoreService method start.

/**
     * Creates the naming store if not provided by the constructor.
     *
     * @param context The start context
     * @throws StartException If any problems occur creating the context
     */
public void start(final StartContext context) throws StartException {
    if (store == null) {
        final ServiceRegistry serviceRegistry = context.getController().getServiceContainer();
        final ServiceName serviceNameBase = context.getController().getName();
        final ServiceTarget serviceTarget = context.getChildTarget();
        store = readOnly ? new ServiceBasedNamingStore(serviceRegistry, serviceNameBase) : new WritableServiceBasedNamingStore(serviceRegistry, serviceNameBase, serviceTarget);
    }
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) WritableServiceBasedNamingStore(org.jboss.as.naming.WritableServiceBasedNamingStore) ServiceBasedNamingStore(org.jboss.as.naming.ServiceBasedNamingStore) ServiceTarget(org.jboss.msc.service.ServiceTarget) WritableServiceBasedNamingStore(org.jboss.as.naming.WritableServiceBasedNamingStore) ServiceRegistry(org.jboss.msc.service.ServiceRegistry)

Aggregations

ServiceBasedNamingStore (org.jboss.as.naming.ServiceBasedNamingStore)3 WritableServiceBasedNamingStore (org.jboss.as.naming.WritableServiceBasedNamingStore)1 ServiceName (org.jboss.msc.service.ServiceName)1 ServiceRegistry (org.jboss.msc.service.ServiceRegistry)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1