[JBoss OSGi Development] - Re: OSGi WebApps on JBossWeb
by thomas.diesler@jboss.com
"Burr" wrote :
| Will this feature allow me to have 2 of the same .war files deployed at the same time but with different version numbers and with possibly different implementations?
|
| If so, how will we "route" requests to the right version of the .war file?
|
| If so, how will we handle http session replication across a cluster, like when the 2 versions of the .war file have slightly different implementations of POJOs that used in the session (e.g. ShoppingCart, UserProfile)?
|
I would assume that the deployment name would have to be different (i.e. mywebapp_v1.war, mywebapp_v2.war). Each webapp would have to be deployed to its own http context.
OSGi Package-Import manifest headers would make sure that each webapp is wired to the correct implementation
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262176#4262176
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262176
16 years, 2 months
[JBoss Microcontainer Development POJO Server] - Re: AS weld-int
by alesj
"kabir.khan(a)jboss.com" wrote :
| a) I need the BeanManager. BootstrapBean is initialised, so I can call BB.getWeldManager(). I do however need access to the bean manager to use, which I can get from the (Flat)Deployment attachment. I do see some issues down the line if a deployment has several bean managers, but want to get something up and running before digging into that.
|
This is the name under which BootstrapBean is registered in MC:
* String bootstrapName = DeployersUtils.getBootstrapBeanName(unit);
"kabir.khan(a)jboss.com" wrote :
| b) How do I make sure that WeldKernelControllerContexts are deployed instead of KernelControllerContexts? Replace BeanMetaDataDeployer with something else?
|
Yes.
I would rather change BMDDeployer than go down that ugly path you describe in your 2nd post. :-)
e.g.
Have a list of ControllerContext creators in BMDDeployer,
short circuit-ing on 1st return context instance; by default creating KCC.
"kabir.khan(a)jboss.com" wrote :
| This is done by BootstrapBean.boot() which is called as part of BootstrapBean's start phase. I need to make sure this happens after 2), which looks like it is the case in BootDeployerTestCase, due to some mysterious dependency on EjbContainer#1 (line 79)
|
This is the magic that does it:
| // call dynamic dependency creator for EJBs
| ParameterMetaDataBuilder install = bootstrap.addInstallWithParameters("createDepenencies", "DynamicDependencyCreator", null, ControllerState.CONFIGURED);
| install.addParameterMetaData(Object.class.getName(), bootstrapName);
| install.addParameterMetaData(Iterable.class.getName(), bootstrap.createInject(ejbServicesValue.getUnderlyingValue(), "ejbContainerNames"));
| install.addParameterMetaData(String.class.getName(), "Start");
| install.addParameterMetaData(String.class.getName(), "Start");
|
| /**
| * Create dependencies to target bean.
| *
| * @param targetName the target bean name
| * @param dependencies dependencies names
| * @param whenRequiredState when required state
| * @param dependentState dependencies dependent state
| */
| public void createDepenencies(Object targetName, Iterable<String> dependencies, String whenRequiredState, String dependentState)
| {
| if (targetName == null)
| throw new IllegalArgumentException("Null target name");
| if (dependencies == null)
| throw new IllegalArgumentException("Null dependecies");
|
| ControllerContext targetControllerContext = controller.getContext(targetName, null);
| if (targetControllerContext == null)
| throw new IllegalArgumentException("No such target bean installed: " + targetName);
|
| Throwable error = targetControllerContext.getError();
| if (error != null)
| throw new IllegalArgumentException("Target bean " + targetName + " is in Error state: " + error);
|
| ControllerState whenRequired;
| if (whenRequiredState == null)
| whenRequired = ControllerState.INSTALLED;
| else
| whenRequired = new ControllerState(whenRequiredState);
|
| ControllerState currentTargetState = targetControllerContext.getState();
| if (controller.getStates().isBeforeState(currentTargetState, whenRequired) == false)
| throw new IllegalArgumentException("Target bean " + targetName + " is already past " + whenRequiredState + " state: " + targetControllerContext);
|
| ControllerState dependent = null;
| if (dependentState != null)
| dependent = new ControllerState(dependentState);
|
| DependencyInfo di = targetControllerContext.getDependencyInfo();
| for (Object dependency : dependencies)
| {
| DependencyItem item = new AbstractDependencyItem(targetName, dependency, whenRequired, dependent);
| di.addIDependOn(item);
| }
| }
|
;-)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262171#4262171
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262171
16 years, 2 months