public void addResourceEnvRef(final ContextResourceEnvRef resourceEnvRef) { bindResource(resourceEnvRef); }
public void propertyChange(final PropertyChangeEvent event) { if (!running) { return; } final Object source = event.getSource(); if (source == namingResources) { processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); } }
ContextEjb ejb = (ContextEjb) oldValue; if (ejb.getName() != null) { removeEjb(ejb.getName()); ContextEjb ejb = (ContextEjb) newValue; if (ejb.getName() != null) { addEjb(ejb); ContextEnvironment env = (ContextEnvironment) oldValue; if (env.getName() != null) { removeEnvironment(env.getName()); ContextEnvironment env = (ContextEnvironment) newValue; if (env.getName() != null) { addEnvironment(env); ContextLocalEjb ejb = (ContextLocalEjb) oldValue; if (ejb.getName() != null) { removeLocalEjb(ejb.getName()); ContextLocalEjb ejb = (ContextLocalEjb) newValue; if (ejb.getName() != null) { addLocalEjb(ejb); ContextResource resource = (ContextResource) oldValue; if (resource.getName() != null) { removeResource(resource.getName()); ContextResource resource = (ContextResource) newValue;
private void processInitialNamingResources() { // Resource links ContextResourceLink[] resourceLinks = namingResources.findResourceLinks(); for (ContextResourceLink resourceLink : resourceLinks) { addResourceLink(resourceLink); } // Resources ContextResource[] resources = namingResources.findResources(); for (ContextResource resource : resources) { addResource(resource); } // Resources Env ContextResourceEnvRef[] resourceEnvRefs = namingResources.findResourceEnvRefs(); for (ContextResourceEnvRef resourceEnvRef : resourceEnvRefs) { addResourceEnvRef(resourceEnvRef); } // Environment entries ContextEnvironment[] contextEnvironments = namingResources.findEnvironments(); for (ContextEnvironment contextEnvironment : contextEnvironments) { addEnvironment(contextEnvironment); } // EJB references ContextEjb[] ejbs = namingResources.findEjbs(); for (ContextEjb ejb : ejbs) { addEjb(ejb); } }
OpenEJBNamingContextListener namingContextListener = new OpenEJBNamingContextListener(standardServer); namingContextListener.start();
public void start() { if (running) return; namingResources.addPropertyChangeListener(this); processInitialNamingResources(); running = true; }
final ContextEjb ejb = (ContextEjb) oldValue; if (ejb.getName() != null) { removeEjb(ejb.getName()); final ContextEjb ejb = (ContextEjb) newValue; if (ejb.getName() != null) { addEjb(ejb); final ContextEnvironment env = (ContextEnvironment) oldValue; if (env.getName() != null) { removeEnvironment(env.getName()); final ContextEnvironment env = (ContextEnvironment) newValue; if (env.getName() != null) { addEnvironment(env); final ContextLocalEjb ejb = (ContextLocalEjb) oldValue; if (ejb.getName() != null) { removeLocalEjb(ejb.getName()); final ContextLocalEjb ejb = (ContextLocalEjb) newValue; if (ejb.getName() != null) { addLocalEjb(ejb); final ContextResource resource = (ContextResource) oldValue; if (resource.getName() != null) { removeResource(resource.getName()); final ContextResource resource = (ContextResource) newValue;
private void processInitialNamingResources() { // Resource links final ContextResourceLink[] resourceLinks = namingResources.findResourceLinks(); for (final ContextResourceLink resourceLink : resourceLinks) { addResourceLink(resourceLink); } // Resources final ContextResource[] resources = namingResources.findResources(); for (final ContextResource resource : resources) { addResource(resource); } // Resources Env final ContextResourceEnvRef[] resourceEnvRefs = namingResources.findResourceEnvRefs(); for (final ContextResourceEnvRef resourceEnvRef : resourceEnvRefs) { addResourceEnvRef(resourceEnvRef); } // Environment entries final ContextEnvironment[] contextEnvironments = namingResources.findEnvironments(); for (final ContextEnvironment contextEnvironment : contextEnvironments) { addEnvironment(contextEnvironment); } // EJB references final ContextEjb[] ejbs = namingResources.findEjbs(); for (final ContextEjb ejb : ejbs) { addEjb(ejb); } }
final OpenEJBNamingContextListener namingContextListener = new OpenEJBNamingContextListener(standardServer); namingContextListener.start();
public void start() { if (running) { return; } namingResources.addPropertyChangeListener(this); processInitialNamingResources(); running = true; }
public void addResourceEnvRef(ContextResourceEnvRef resourceEnvRef) { bindResource(resourceEnvRef); }
public void propertyChange(PropertyChangeEvent event) { if (!running) return; Object source = event.getSource(); if (source == namingResources) { processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); } }
public void addResource(final ContextResource resource) { bindResource(resource); }
public void addEnvironment(ContextEnvironment env) { bindResource(env); }
public void addResource(ContextResource resource) { bindResource(resource); }
public void addEnvironment(final ContextEnvironment env) { bindResource(env); }
private void bindResource(final ResourceBase res) { try { final Context globalNamingContext = standardServer.getGlobalNamingContext(); final Object value = globalNamingContext.lookup(res.getName()); final String type = res.getType(); bindResource(res.getName(), value, type); } catch (final NamingException e) { logger.error("Unable to lookup Global Tomcat resource " + res.getName(), e); } }
private void bindResource(ResourceBase res) { try { Context globalNamingContext = standardServer.getGlobalNamingContext(); Object value = globalNamingContext.lookup(res.getName()); String type = res.getType(); bindResource(res.getName(), value, type); } catch (NamingException e) { logger.error("Unable to lookup Global Tomcat resource " + res.getName(), e); } }