private boolean hasWebservicesMD(final Endpoint endpoint) { final Deployment dep = endpoint.getService().getDeployment(); return dep.getAttachment(WebservicesMetaData.class) != null; }
public static void undoPublishStep(WebHost host, Context wsctx) throws Exception { List<Endpoint> eps = wsctx.getEndpoints(); if (eps == null || eps.isEmpty()) { return; } EndpointPublisherImpl publisher = new EndpointPublisherImpl(host, true); publisher.stopWebApp(eps.get(0).getService().getDeployment()); }
public static void undoPublishStep(WebHost host, Context wsctx) throws Exception { List<Endpoint> eps = wsctx.getEndpoints(); if (eps == null || eps.isEmpty()) { return; } EndpointPublisherImpl publisher = new EndpointPublisherImpl(host, true); publisher.stopWebApp(eps.get(0).getService().getDeployment()); }
@Override public void destroy(Context context) throws Exception { List<Endpoint> eps = context.getEndpoints(); if (eps == null || eps.isEmpty()) { return; } Deployment dep = eps.get(0).getService().getDeployment(); try { stopWebApp(dep); } finally { undeploy(dep); } }
@Override public void destroy(Context context) throws Exception { List<Endpoint> eps = context.getEndpoints(); if (eps == null || eps.isEmpty()) { return; } Deployment dep = eps.get(0).getService().getDeployment(); try { stopWebApp(dep); } finally { undeploy(dep); } }
private static String getDeploymentSecurityDomainName(final Endpoint ep) { JBossWebMetaData metadata = ep.getService().getDeployment().getAttachment(JBossWebMetaData.class); String metaDataSecurityDomain = metadata != null ? metadata.getSecurityDomain() : null; return metaDataSecurityDomain == null ? SecurityConstants.DEFAULT_APPLICATION_POLICY : SecurityUtil.unprefixSecurityDomain(metaDataSecurityDomain.trim()); }
/** * Sets runtime classloader for JSE endpoints */ private void setRuntimeLoader() { final Deployment dep = endpoint.getService().getDeployment(); if (isJseDeployment(dep)) { ClassLoader classLoader = getContextClassLoader(); dep.setRuntimeClassLoader(classLoader); } }
private void setInjectionAwareInstanceProvider(final Endpoint ep) { final InstanceProvider stackInstanceProvider = ep.getInstanceProvider(); final DeploymentUnit unit = ep.getService().getDeployment().getAttachment(DeploymentUnit.class); final InstanceProvider injectionAwareInstanceProvider = new InjectionAwareInstanceProvider(stackInstanceProvider, ep, unit); ep.setInstanceProvider(injectionAwareInstanceProvider); }
private static String getDeploymentSecurityDomainName(final Endpoint ep, final DeploymentUnit unit) { JBossWebMetaData metadata = ep.getService().getDeployment().getAttachment(JBossWebMetaData.class); String metaDataSecurityDomain = metadata != null ? metadata.getSecurityDomain() : null; if (metaDataSecurityDomain == null) { if (unit.hasAttachment(UndertowAttachments.DEFAULT_SECURITY_DOMAIN)) { metaDataSecurityDomain = unit.getAttachment(UndertowAttachments.DEFAULT_SECURITY_DOMAIN); } else { metaDataSecurityDomain = SecurityConstants.DEFAULT_APPLICATION_POLICY; } } else { metaDataSecurityDomain = SecurityUtil.unprefixSecurityDomain(metaDataSecurityDomain.trim()); } return metaDataSecurityDomain; }
/** * Gets EJB security meta data if associated with EJB endpoint. * * @param endpoint EJB webservice endpoint * @return EJB security meta data or null */ private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) { final String ejbName = endpoint.getShortName(); final Deployment dep = endpoint.getService().getDeployment(); final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class); final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null; return ejbMD != null ? ejbMD.getSecurityMetaData() : null; }
private void setInjectionAwareInstanceProvider(final Endpoint ep) { final InstanceProvider stackInstanceProvider = ep.getInstanceProvider(); final DeploymentUnit unit = ep.getService().getDeployment().getAttachment(DeploymentUnit.class); final InstanceProvider injectionAwareInstanceProvider = new InjectionAwareInstanceProvider(stackInstanceProvider, ep, unit); ep.setInstanceProvider(injectionAwareInstanceProvider); }
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig) { BusHolder holder = endpoint.getService().getDeployment().getAttachment(BusHolder.class); //set the bus from deployment into the CXF servlet and assign it to the current thread (do not touch the default bus!) bus = holder.getBus(); BusFactory.setThreadDefaultBus(bus); //update the resource manager adding the ServletContextResourceResolver that was to be added by CXF servlet ResourceManager resourceManager = bus.getExtension(ResourceManager.class); resourceManager.addResourceResolver(new ServletContextResourceResolver(servletConfig.getServletContext())); }
private void setInjectionAwareInstanceProvider(final Endpoint ep) { final InstanceProvider stackInstanceProvider = ep.getInstanceProvider(); final DeploymentUnit unit = ep.getService().getDeployment().getAttachment(DeploymentUnit.class); final InstanceProvider injectionAwareInstanceProvider = new InjectionAwareInstanceProvider(stackInstanceProvider, ep, unit); ep.setInstanceProvider(injectionAwareInstanceProvider); }
/** * Gets EJB security meta data if associated with EJB endpoint. * * @param endpoint EJB webservice endpoint * @return EJB security meta data or null */ private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) { final String ejbName = endpoint.getShortName(); final Deployment dep = endpoint.getService().getDeployment(); final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class); final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null; return ejbMD != null ? ejbMD.getSecurityMetaData() : null; }
/** * Gets EJB security meta data if associated with EJB endpoint. * * @param endpoint EJB webservice endpoint * @return EJB security meta data or null */ private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) { final String ejbName = endpoint.getShortName(); final Deployment dep = endpoint.getService().getDeployment(); final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class); final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null; return ejbMD != null ? ejbMD.getSecurityMetaData() : null; }
public void init(Endpoint ep) { String ejbName = ep.getShortName(); ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment(); String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName(); if (dep.getParent() != null) { nameStr += ",ear=" + dep.getParent().getSimpleName(); } objectName = ObjectNameFactory.create(nameStr.toString()); Dispatcher dispatcher = Dispatcher.singleton; if (dispatcher.getRegistered(objectName.getCanonicalName()) == null) throw new WebServiceException("Cannot find service endpoint target: " + objectName); }
/** * Gets EJB security meta data if associated with EJB endpoint. * * @param endpoint EJB webservice endpoint * @return EJB security meta data or null */ private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) { final String ejbName = endpoint.getShortName(); final Deployment dep = endpoint.getService().getDeployment(); final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class); final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null; return ejbMD != null ? ejbMD.getSecurityMetaData() : null; }
public void init(Endpoint ep) { String ejbName = ep.getShortName(); ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment(); String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName(); if (dep.getParent() != null) { nameStr += ",ear=" + dep.getParent().getSimpleName(); } objectName = ObjectNameFactory.create(nameStr.toString()); Dispatcher dispatcher = Dispatcher.singleton; if (dispatcher.getRegistered(objectName.getCanonicalName()) == null) throw new WebServiceException("Cannot find service endpoint target: " + objectName); }
public void init(Endpoint ep) { String ejbName = ep.getShortName(); ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment(); String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName(); if (dep.getParent() != null) { nameStr += ",ear=" + dep.getParent().getSimpleName(); } objectName = ObjectNameFactory.create(nameStr.toString()); Dispatcher dispatcher = Dispatcher.singleton; if (dispatcher.getRegistered(objectName.getCanonicalName()) == null) throw new WebServiceException("Cannot find service endpoint target: " + objectName); }
/** * Gets EJB security meta data if associated with EJB endpoint. * * @param endpoint EJB webservice endpoint * @return EJB security meta data or null */ private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) { final String ejbName = endpoint.getShortName(); final Deployment dep = endpoint.getService().getDeployment(); final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class); final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null; return ejbMD != null ? ejbMD.getSecurityMetaData() : null; }