@Override // TODO: what to do in JNDI if multiple views are available for no interface view ? public ServiceName getServiceName() { return super.getServiceName().append(methodIntf.toString()); }
/** * Creates view configuration. Allows for extensibility in EE sub components. * * @param viewClass view class * @param componentConfiguration component config * @param proxyFactory proxy factory * @return new view configuration */ public ViewConfiguration createViewConfiguration(final Class<?> viewClass, final ComponentConfiguration componentConfiguration, final ProxyFactory<?> proxyFactory) { return new ViewConfiguration(viewClass, componentConfiguration, getServiceName(), proxyFactory); }
public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEApplicationDescription applicationDescription = deploymentUnit.getAttachment(EE_APPLICATION_DESCRIPTION); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT); final Set<ViewDescription> componentsForViewName = applicationDescription.getComponentsForViewName(typeName, deploymentRoot.getRoot()); final Iterator<ViewDescription> iterator = componentsForViewName.iterator(); if (!iterator.hasNext()) { throw EeLogger.ROOT_LOGGER.componentNotFound(typeName); } final ViewDescription description = iterator.next(); if (iterator.hasNext()) { throw EeLogger.ROOT_LOGGER.multipleComponentsFound(typeName); } //TODO: should ComponentView also be a managed reference factory? serviceBuilder.addDependency(description.getServiceName(), ComponentView.class, new ViewManagedReferenceFactory.Injector(injector)); }
@Override public void configure(final DeploymentPhaseContext context, final ComponentConfiguration componentConfiguration, final ViewDescription description, final ViewConfiguration configuration) throws DeploymentUnitProcessingException { boolean appclient = context.getDeploymentUnit().getAttachment(Attachments.EE_MODULE_DESCRIPTION).isAppClient(); // Create view bindings final List<BindingConfiguration> bindingConfigurations = configuration.getBindingConfigurations(); for (String bindingName : description.getBindingNames()) { bindingConfigurations.add(new BindingConfiguration(bindingName, description.createInjectionSource(description.getServiceName(), Values.immediateValue(componentConfiguration.getModuleClassLoader()), appclient))); } } }
localViews.put(view.getViewClassName(), componentViewInjectedValue); injectedValues.put(view.getServiceName(), componentViewInjectedValue);
viewServices.put(view.getViewClassName(), view.getServiceName());
protected ServiceName getProcessApplicationViewServiceName(ComponentDescription paComponent) { Set<ViewDescription> views = paComponent.getViews(); if(views == null || views.isEmpty()) { return null; } else { ViewDescription next = views.iterator().next(); return next.getServiceName(); } }
protected ServiceName getProcessApplicationViewServiceName(ComponentDescription paComponent) { Set<ViewDescription> views = paComponent.getViews(); if(views == null || views.isEmpty()) { return null; } else { ViewDescription next = views.iterator().next(); return next.getServiceName(); } }
protected ServiceName getProcessApplicationViewServiceName(ComponentDescription paComponent) { Set<ViewDescription> views = paComponent.getViews(); if(views == null || views.isEmpty()) { return null; } else { ViewDescription next = views.iterator().next(); return next.getServiceName(); } }
/** * Creates view configuration. Allows for extensibility in EE sub components. * * @param viewClass view class * @param componentConfiguration component config * @param proxyFactory proxy factory * @return new view configuration */ public ViewConfiguration createViewConfiguration(final Class<?> viewClass, final ComponentConfiguration componentConfiguration, final ProxyFactory<?> proxyFactory) { return new ViewConfiguration(viewClass, componentConfiguration, getServiceName(), proxyFactory); }
/** * Creates view configuration. Allows for extensibility in EE sub components. * * @param viewClass view class * @param componentConfiguration component config * @param proxyFactory proxy factory * @return new view configuration */ public ViewConfiguration createViewConfiguration(final Class<?> viewClass, final ComponentConfiguration componentConfiguration, final ProxyFactory<?> proxyFactory) { return new ViewConfiguration(viewClass, componentConfiguration, getServiceName(), proxyFactory); }
@Override // TODO: what to do in JNDI if multiple views are available for no interface view ? public ServiceName getServiceName() { return super.getServiceName().append(methodIntf.toString()); }
protected ServiceName getProcessApplicationViewServiceName(ComponentDescription paComponent) { Set<ViewDescription> views = paComponent.getViews(); if(views == null || views.isEmpty()) { return null; } else { ViewDescription next = views.iterator().next(); return next.getServiceName(); } }
protected ServiceName getProcessApplicationViewServiceName(ComponentDescription paComponent) { Set<ViewDescription> views = paComponent.getViews(); if(views == null || views.isEmpty()) { return null; } else { ViewDescription next = views.iterator().next(); return next.getServiceName(); } }
/** * Creates view configuration. Allows for extensibility in EE sub components. * * @param viewClass view class * @param componentConfiguration component config * @param proxyFactory proxy factory * @return new view configuration */ public ViewConfiguration createViewConfiguration(final Class<?> viewClass, final ComponentConfiguration componentConfiguration, final ProxyFactory<?> proxyFactory) { return new ViewConfiguration(viewClass, componentConfiguration, getServiceName(), proxyFactory); }
private ComponentView getComponentView(ViewDescription viewDescription) { final ServiceController<?> controller = serviceRegistry.getService(viewDescription.getServiceName()); if (controller == null) { return null; } return (ComponentView) controller.getValue(); }
static ServiceName registerView(final ComponentDescription componentDescription, final String componentClassName) { final ViewDescription pojoView = new ViewDescription(componentDescription, componentClassName); componentDescription.getViews().add(pojoView); pojoView.getConfigurators().add(new ViewConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentConfiguration componentConfiguration, ViewDescription description, ViewConfiguration configuration) throws DeploymentUnitProcessingException { // add WS POJO component instance associating interceptor configuration.addViewInterceptor(WSComponentInstanceAssociationInterceptor.FACTORY, InterceptorOrder.View.ASSOCIATING_INTERCEPTOR); } }); return pojoView.getServiceName(); }
@Override public void configure(final DeploymentPhaseContext context, final ComponentConfiguration componentConfiguration, final ViewDescription description, final ViewConfiguration configuration) throws DeploymentUnitProcessingException { // Create view bindings final List<BindingConfiguration> bindingConfigurations = configuration.getBindingConfigurations(); for (String bindingName : description.getBindingNames()) { bindingConfigurations.add(new BindingConfiguration(bindingName, description.createInjectionSource(description.getServiceName(), Values.immediateValue(componentConfiguration.getModuleClassLoader())))); } } }
@Override public void configure(final DeploymentPhaseContext context, final ComponentConfiguration componentConfiguration, final ViewDescription description, final ViewConfiguration configuration) throws DeploymentUnitProcessingException { boolean appclient = context.getDeploymentUnit().getAttachment(Attachments.EE_MODULE_DESCRIPTION).isAppClient(); // Create view bindings final List<BindingConfiguration> bindingConfigurations = configuration.getBindingConfigurations(); for (String bindingName : description.getBindingNames()) { bindingConfigurations.add(new BindingConfiguration(bindingName, description.createInjectionSource(description.getServiceName(), Values.immediateValue(componentConfiguration.getModuleClassLoader()), appclient))); } } }
@Override public void configure(final DeploymentPhaseContext context, final ComponentConfiguration componentConfiguration, final ViewDescription description, final ViewConfiguration configuration) throws DeploymentUnitProcessingException { boolean appclient = context.getDeploymentUnit().getAttachment(Attachments.EE_MODULE_DESCRIPTION).isAppClient(); // Create view bindings final List<BindingConfiguration> bindingConfigurations = configuration.getBindingConfigurations(); for (String bindingName : description.getBindingNames()) { bindingConfigurations.add(new BindingConfiguration(bindingName, description.createInjectionSource(description.getServiceName(), Values.immediateValue(componentConfiguration.getModuleClassLoader()), appclient))); } } }