protected Component getComponent() { if (component==null) { component = Component.forName(componentName); } return component; }
private boolean isPerNestedConversation(String name) { Component component = Component.forName(name); return (component != null) && component.isPerNestedConversation(); }
/** * Get the Seam component, even if no application context * is associated with the current thread. */ public static Component componentForName(String name) { if ( Contexts.isApplicationContextActive() ) { return Component.forName(name); } else { Lifecycle.setupApplication(); try { return Component.forName(name); } finally { Lifecycle.cleanupApplication(); } } }
@Override public void setElement(Element element) { super.setElement(element); String beanType = element.attributeValue("type"); Component component = Component.forName(beanType); if (component != null) { value = component.newInstance(); } else { try { value = Reflections.classForName(beanType).newInstance(); } catch (Exception ex) { throw new RuntimeException("Could not unmarshal bean element: " + element.getText(), ex); } } }
Component component = Component.forName(componentName); if (component == null)
public static StatusMessages instance() { Component component = Component.forName(StatusMessages.COMPONENT_NAME); if(component != null && !component.getScope().isContextActive()) { throw new IllegalStateException("No active "+component.getScope().name()+" context"); } //Attempting to get the instance anyway for backwards compatibility with some potential hack situations. return (StatusMessages) Component.getInstance(COMPONENT_NAME); }
public static FacesMessages instance() { Component component = Component.forName(StatusMessages.COMPONENT_NAME); if(component != null && !component.getScope().isContextActive()) { throw new IllegalStateException("No active "+component.getScope().name()+" context"); } //Attempting to get the instance anyway for backwards compatibility with some potential hack situations. return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME); } }
Component component = componentName != null ? Component.forName(componentName) : null;
Component component = Component.forName(name); if (component == null)
protected static void runTasks() { Component component = Component.forName(StatusMessages.COMPONENT_NAME); if( component != null && !component.getScope().isContextActive() ) { return; } //Attempting to get the instance anyway for backwards compatibility with some potential hack situations. StatusMessages statusMessages = instance(); if ( statusMessages != null ) { statusMessages.doRunTasks(); } }
private void processInvocation() throws Exception Component component = Component.forName(componentName);
/** * Just like Component.forName() but mocks the applicationContext and you provide it with the spring bean name * instead of the seam component name. * * @param springBeanName the spring bean name. * @return the SpringComponent mapped to that spring bean name. */ public static SpringComponent forSpringBeanName(String springBeanName) { // TODO reuse boolean unmockApplication = false; if (!Contexts.isApplicationContextActive()) { Lifecycle.setupApplication(); unmockApplication = true; } try { return (SpringComponent) Component.forName(getSpringComponentNameMap().get(springBeanName)); } finally { if (unmockApplication) { Lifecycle.cleanupApplication(); } } }
Component component = Component.forName(serviceIntfName);
protected static synchronized List<SeamComponentInfo> listNuxeoComponents() { if (components == null) { components = new ArrayList<>(); for (String cName : listAllComponentsNames()) { SeamComponentInfoImpl desc = new SeamComponentInfoImpl(); Component comp = Component.forName(cName); String className = comp.getBeanClass().getName(); // if (className.startsWith("org.nuxeo")) { if (!className.startsWith("org.jboss")) { desc.setName(cName); desc.setScope(comp.getScope().toString()); desc.setClassName(className); @SuppressWarnings("rawtypes") Set<Class> ifaces = comp.getBusinessInterfaces(); if (ifaces != null && ifaces.size() > 0) { for (Class<?> iface : ifaces) { desc.addInterfaceName(iface.getName()); } } desc.addInterfaceName(comp.getBeanClass().getName()); components.add(desc); } } Collections.sort(components); } return components; } }
if (Component.forName(componentName) != null)
/** * Startup a component and all its dependencies */ static void startup(Component component) { if ( component.isStartup() ) { for ( String dependency: component.getDependencies() ) { Component dependentComponent = Component.forName(dependency); if (dependentComponent!=null) { startup(dependentComponent); } } } if ( !component.getScope().getContext().isSet( component.getName() ) ) { log.debug( "starting up: " + component.getName() ); component.newInstance(); } }
if ( out.scope()==UNSPECIFIED ) component = Component.forName(name); if (value!=null && component!=null)
private static Object getInstance(String name, boolean create, boolean allowAutoCreation, Object result, ScopeType scope) { Component component = Component.forName(name);
for ( String name: init.getHotDeployableComponents() ) Component component = Component.forName(name); if (component!=null)
Component component = Component.forName(name); log.debug("destroying: " + name); if ( component!=null )