/** * Remove a container from this deployment unit. * * @param con */ public void removeContainer(Container con) { containers.remove(con.getBeanMetaData().getEjbName()); containerOrdering.remove(con); }
EjbModule ejbModule = (EjbModule) server.getAttribute(containerName, "EjbModule"); ObjectName ejbModName = EJBModuleFactory.getEJBModuleName(ejbModule.getServiceName()); String ejbName = metaData.getEjbName(); String jndiName = metaData.getJndiName(); String localJndiName = metaData.getLocalJndiName(); int type = EJB.STATELESS_SESSION_BEAN; if (metaData.isSession()) type = EJB.STATEFUL_SESSION_BEAN; else if (metaData.isMessageDriven()) type = EJB.MESSAGE_DRIVEN_BEAN; else
/** * Gets the container jndi name used in the object name * * @return the jndi name suitable for use as the jndi name */ public String getContainerObjectNameJndiName() { return getHome() != null ? getJndiName() : getLocalJndiName(); }
/** * Get an invoker binding * * @param invokerName the invoker proxy binding name * @return the jndi name */ public String getInvokerBinding(String invokerName) { InvokerBindingMetaData binding = getDelegate().determineInvokerBinding(invokerName); String bindingName = binding.getJndiName(); if(bindingName == null) { bindingName = isMessageDriven() ? getEjbName() : getJndiName(); } return bindingName; }
protected void checkCoherency () throws Exception { // Check clustering cohrency wrt metadata // if (metaData.isClustered()) { boolean clusteredProxyFactoryFound = false; for (Iterator it = proxyFactories.keySet().iterator(); it.hasNext(); ) { String invokerBinding = (String)it.next(); EJBProxyFactory ci = (EJBProxyFactory)proxyFactories.get(invokerBinding); if (ci instanceof org.jboss.proxy.ejb.ClusterProxyFactory) clusteredProxyFactoryFound = true; } if (!clusteredProxyFactoryFound) { log.warn("*** EJB '" + this.metaData.getEjbName() + "' deployed as CLUSTERED but not a single clustered-invoker is bound to container ***"); } } }
ubmd.setEjbName(bmd.getEjbName()); ubmd.setEjbClass(bmd.getEjbClass()); ubmd.setServiceEndpointInterface(bmd.getServiceEndpoint()); ubmd.setHome(bmd.getHome()); ubmd.setLocalHome(bmd.getLocalHome()); ubmd.setJndiName(bmd.getJndiName()); ubmd.setLocalJndiName(bmd.getLocalJndiName()); EjbPortComponentMetaData pcmd = bmd.getPortComponent(); if (pcmd != null)
log.debug("Begin java:comp/env for EJB: " + beanMetaData.getEjbName()); ClassLoader tcl = SecurityActions.getContextClassLoader(); log.debug("TCL: " + tcl); log.debug("Bound java:comp/ORB for EJB: " + getBeanMetaData().getEjbName()); log.debug("Bound java:comp/HandleDelegate for EJB: " + getBeanMetaData().getEjbName()); Iterator i = beanMetaData.getEnvironmentEntries(); while (i.hasNext()) Iterator i = beanMetaData.getEjbReferences(); while (i.hasNext()) String msg = "Failed to resolve ejb-link: " + linkName + " from ejb-ref: " + ref.getName() + " in ejb: " + beanMetaData.getEjbName(); throw new DeploymentException(msg); Iterator it = beanMetaData.getInvokerBindings(); Reference reference = null; while (it.hasNext()) Iterator i = beanMetaData.getEjbLocalReferences(); while (i.hasNext()) Iterator<ServiceReferenceMetaData> serviceReferences = beanMetaData.getServiceReferences(); if (serviceReferences != null) Iterator i = beanMetaData.getResourceReferences();
public EjbPortComponentMetaData getPortComponent() { JBossMetaData jmd = getDelegate().getJBossMetaDataWithCheck(); JBossSessionBeanMetaData jebmd = (JBossSessionBeanMetaData) jmd.getEnterpriseBean(this.getEjbName()); return new EjbPortComponentMetaData(jebmd.getPortComponent()); }
private JDBCEntityMetaData loadJDBCEntityMetaData() throws DeploymentException { ApplicationMetaData amd = container.getBeanMetaData().getApplicationMetaData(); // Get JDBC MetaData JDBCApplicationMetaData jamd = (JDBCApplicationMetaData)amd.getPluginData(CMP_JDBC); if(jamd == null) { // we are the first cmp entity to need jbosscmp-jdbc. // Load jbosscmp-jdbc.xml for the whole application JDBCXmlFileLoader jfl = new JDBCXmlFileLoader(container, log); jamd = jfl.load(); amd.addPluginData(CMP_JDBC, jamd); } // Get JDBC Bean MetaData String ejbName = container.getBeanMetaData().getEjbName(); JDBCEntityMetaData metadata = jamd.getBeanByEjbName(ejbName); if(metadata == null) { throw new DeploymentException("No metadata found for bean " + ejbName); } return metadata; }
ApplicationMetaData applicationMetaData = beanMetaData.getApplicationMetaData(); AssemblyDescriptorMetaData assemblyDescriptor = applicationMetaData.getAssemblyDescriptor(); securityRoles = assemblyDescriptor.getSecurityRoles(); deploymentRoles = assemblyDescriptor.getPrincipalVersusRolesMap(); SecurityIdentityMetaData secMetaData = beanMetaData.getSecurityIdentityMetaData(); if (secMetaData != null && secMetaData.getUseCallerIdentity() == false) appSecurityDomain = SecurityUtil.unprefixSecurityDomain(appSecurityDomain); ejbName = beanMetaData.getEjbName(); ejbCS = container.getBeanClass().getProtectionDomain().getCodeSource(); securityManagement = (ISecurityManagement) container.getSecurityManagement();
String securityDomain = bean.getApplicationMetaData().getSecurityDomain(); log.warn("EJB configured to bypass security. Please verify if this is intended. Bean=" + bean.getEjbName() + " Deployment=" + unit.getName()); String securityProxyClassName = bean.getSecurityProxy(); if (securityProxyClassName != null)
public void create() throws Exception { super.start(); BeanMetaData md = getContainer().getBeanMetaData(); ejbName = md.getEjbName(); // Should we log call details callLogging = md.getContainerConfiguration().getCallLogging(); }
log.info("Deploying " + bean.getEjbName()); Container con = createContainer(bean, deploymentUnit); addContainer(con); for (String dependsName : metaData.getDepends()) Iterator<String> invokerBindings = metaData.getInvokerBindings(); while (invokerBindings != null && invokerBindings.hasNext())
/** * The EJBDeployer calls this method. The EJBDeployer has set * all the plugins and interceptors that this bean requires and now proceeds * to initialize the chain. The method looks for the standard classes in * the URL, sets up the naming environment of the bean. The concrete * container classes should override this method to introduce * implementation specific initialization behaviour. * * @throws Exception if loading the bean class failed * (ClassNotFoundException) or setting up "java:" * naming environment failed (DeploymentException) */ protected void createService() throws Exception { // Acquire classes from CL beanClass = classLoader.loadClass(metaData.getEjbClass()); if (metaData.getLocalHome() != null) localHomeInterface = classLoader.loadClass(metaData.getLocalHome()); if (metaData.getLocal() != null) localInterface = classLoader.loadClass(metaData.getLocal()); localProxyFactory.setContainer(this); localProxyFactory.create(); if (localHomeInterface != null) ejbModule.addLocalHome(this, localProxyFactory.getEJBLocalHome()); ejbModule.createMissingPermissions(this, metaData); // Allow the policy to incorporate the policy configs Policy.getPolicy().refresh(); }
/** * create the service, do expensive operations etc */ public void create () throws Exception { BeanMetaData bmd = con.getBeanMetaData(); ClusterConfigMetaData ccmd = bmd.getClusterConfigMetaData (); String partitionName = ccmd.getPartitionName(); String name = "jboss:service=DistributedState,partitionName="+partitionName; ds = (DistributedState)org.jboss.system.Registry.lookup (name); String ejbName = bmd.getEjbName(); this.DS_CATEGORY = "CMPClusteredInMemoryPersistenceManager-" + ejbName; idField = con.getBeanClass ().getField ("id"); try { isModified = con.getBeanClass ().getMethod ("isModified", new Class[0]); if (!isModified.getReturnType ().equals (Boolean.TYPE)) isModified = null; // Has to have "boolean" as return type! } catch (NoSuchMethodException ignored) { } }
protected void createService() throws Exception { // Initialize the dataStore // Find HASessionState that we will use // String sessionStateName = org.jboss.metadata.ClusterConfigMetaData.DEFAULT_SESSION_STATE_NAME; ClusterConfigMetaData config = con.getBeanMetaData ().getClusterConfigMetaData (); if (config != null) sessionStateName = config.getHaSessionStateName (); Context ctx = new InitialContext (); try { this.sessionState = (HASessionState)ctx.lookup (sessionStateName); } finally { ctx.close(); } this.localNodeName = this.sessionState.getNodeName (); this.appName = this.con.getBeanMetaData ().getJndiName (); this.sessionState.subscribe (this.appName, this); }
private void addMissingMethodPermissions(BeanMetaData bean, boolean exclude, Class iface, InvocationType type, PolicyConfiguration pc) throws PolicyContextException { String ejbName = bean.getEjbName(); HashSet tmp = new HashSet(); getInterfaces(iface, tmp); Class[] ifaces = new Class[tmp.size()]; tmp.toArray(ifaces); for (int n = 0; n < ifaces.length; n++) { Class c = ifaces[n]; Method[] methods = c.getDeclaredMethods(); for (int m = 0; m < methods.length; m++) { String methodName = methods[m].getName(); Class[] params = methods[m].getParameterTypes(); // See if there is a method-permission if (bean.hasMethodPermission(methodName, params, type)) continue; // Create a permission for the missing method-permission EJBMethodPermission p = new EJBMethodPermission(ejbName, type.toInterfaceString(), methods[m]); if (exclude) pc.addToExcludedPolicy(p); else pc.addToUncheckedPolicy(p); } } }
Iterator<SecurityRoleRefMetaData> it = container.getBeanMetaData().getSecurityRoleReferences(); Set<SecurityRoleRef> securityRoleRefs = new HashSet<SecurityRoleRef>(); while(it.hasNext()) String ejbName = container.getBeanMetaData().getEjbName();
if (con.getBeanMetaData().isEntity()) log.debug("startService, starting container: " + con.getBeanMetaData().getEjbName()); serviceController.start(con.getJmxName());