Refine search
public TransactionSynchronizationRegistry getRegistry() { final SystemInstance system = SystemInstance.get(); if (system != this.system) { this.registry = system.getComponent(TransactionSynchronizationRegistry.class); this.system = system; } return registry; }
/** * Gets container system for openejb. * * @return openejb container system */ private CoreContainerSystem getContainerSystem() { if (containerSystem == null) { containerSystem = (CoreContainerSystem) SystemInstance.get().getComponent(org.apache.openejb.spi.ContainerSystem.class); } return containerSystem; }
public JtaTransactionPolicy(TransactionType transactionType, TransactionManager transactionManager) { this.transactionType = transactionType; this.transactionManager = transactionManager; synchronizationRegistry = SystemInstance.get().getComponent(TransactionSynchronizationRegistry.class); }
private CoreContainerSystem getContainerSystem() { if (containerSystem == null) { containerSystem = (CoreContainerSystem) SystemInstance.get().getComponent(ContainerSystem.class); } return containerSystem; }
protected void beforeStart() { rsRegistry = SystemInstance.get().getComponent(RsRegistry.class); if (rsRegistry == null && SystemInstance.get().getComponent(HttpListenerRegistry.class) != null) { rsRegistry = new RsRegistryImpl(); } }
public void init(final ServletConfig config) { ejbServer = SystemInstance.get().getComponent(EjbServer.class); final String activatedStr = config.getInitParameter(ACTIVATED_INIT_PARAM); if (activatedStr != null) { activated = Boolean.getBoolean(ACTIVATED_INIT_PARAM); } }
public T find() { final RESTResourceFinder finder = SystemInstance.get().getComponent(RESTResourceFinder.class); if (finder != null) { return finder.find(clazz); } return null; }
@Override public ServletContext getServletContext() { touch(); return SystemInstance.get().getComponent(ServletContext.class); }
protected Context getContext(String jndiProviderId) throws NamingException { if (jndiProviderId != null) { String contextJndiName = "java:openejb/remote_jndi_contexts/" + jndiProviderId; ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); Context context = (Context) containerSystem.getJNDIContext().lookup(contextJndiName); return context; } else { ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); Context context = containerSystem.getJNDIContext(); return context; } }
public Instance(final Object deploymentId, final Object primaryKey, final Object bean, final Map<String, Object> interceptors, final CreationalContext creationalContext, final JtaEntityManagerRegistry.EntityManagerTracker[] entityManagerArray) { this.beanContext = SystemInstance.get().getComponent(ContainerSystem.class).getBeanContext(deploymentId); if (beanContext == null) { throw new IllegalArgumentException("Unknown deployment " + deploymentId); } this.primaryKey = primaryKey; this.bean = bean; this.interceptors = interceptors; this.creationalContext = creationalContext; this.entityManagerArray = entityManagerArray; }
public Object getObject() throws NamingException { final Object component = SystemInstance.get().getComponent(type); if (component == null) { throw new NameNotFoundException("No " + type.getSimpleName() + " registered with the OpenEJB system"); } return component; } }
private BlockingQueue<Runnable> getQueue() { if (this.threadQueue == null) { // this can be null if timer fires before service is fully initialized final ServicePool incoming = SystemInstance.get().getComponent(ServicePool.class); if (incoming == null) { return null; } this.threadQueue = incoming.getThreadPool().getQueue(); } return this.threadQueue; }
protected void install(ResourceInfo serviceInfo) throws OpenEJBException { if (sys != null) { sys.facilities.resources.add(serviceInfo); } else if (!offline) { Assembler assembler = SystemInstance.get().getComponent(Assembler.class); assembler.createResource(serviceInfo); } }
public void init(ServletConfig config) { ejbServer = SystemInstance.get().getComponent(EjbServer.class); final String activatedStr = config.getInitParameter(ACTIVATED_INIT_PARAM); if (activatedStr != null) { activated = Boolean.parseBoolean(activatedStr); } else { activated = Boolean.parseBoolean(System.getProperty(getClass().getName() + '.' + ACTIVATED_INIT_PARAM, "true")); } }
public OpenEjbConfiguration getOpenEjbConfiguration(final File tmpFile) throws UnauthorizedException { if (tmpFile.exists()) { return SystemInstance.get().getComponent(OpenEjbConfiguration.class); } throw new UnauthorizedException("Machine not authorized to see this server's configuration properties"); }
protected Context getContext() throws NamingException { if (context == null) { if (contextJndiName != null) { final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); context = (Context) containerSystem.getJNDIContext().lookup(contextJndiName); } else { context = new InitialContext(envProperties); } } return context; } }
protected Context getContext() throws NamingException { if (context == null) { if (contextJndiName != null) { ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); context = (Context) containerSystem.getJNDIContext().lookup(contextJndiName); } else { context = new InitialContext(envProperties); } } return context; } }
@Produces @Dependent // think we don't want proxies there, until it is a runtime constraint (which shouldnt) it is fine public Tribestream create() { return SystemInstance.get().getComponent(Container.class).getConfiguration(); } }
private JsonObject getJsonObject(final String part) { final String jsonString = new String(Base64.decodeBase64(part)); JsonFactories jsonFactories = SystemInstance.get().getComponent(JsonFactories.class); return jsonFactories.read(jsonString); }
protected Object readResolve() throws ObjectStreamException { try { final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); if (containerSystem != null) { return containerSystem.getJNDIContext().lookup(jndi); } } catch (final Exception e) { throw new InvalidObjectException("name not found: " + jndi); } return null; } }