[Design of JBossCache] - Re: JBoss Cache Public API
by manik.surtani@jboss.com
"mircea.markus" wrote : move throws an exception if either source or destination does not exist. This is inconsistent with the rest of the API, as it is the only method that trows an exception if nodes(s) are inexistent. E.g. removeNode(fqn) will return a false if the node to be added was not found.
| Here are some suggestions for changing this:
| 1) return a false if either source or destination does not exist (no-op)
| 2) treat it as a remove followed by an put: remove the node (return false if does not exist) and if destination does not exist create it (put semantics).
| I vote for 1, mainly because 2 is hard to explain to the user
You are correct, although I'd vote for 2. Like removeNode(), move() should return a success flag, returning false and not doing anything else if the source node does not exist. It should silently create the destination path if it does not exist just like put(). Not that hard to explain, we do so with put(). :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158268#4158268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158268
16 years, 5 months
[Design of JBoss jBPM] - Problems with using own configuration (e.g. Spring)
by camunda
Hi!
If you are using your own jbpm configuration mechanism (e.g. Spring) what may happen is the following:
1.) Spring initialized the Hibernate stuff
2.) The classes get loaded and somehow instantiated once from Hibernate
3.) The BusinessCalender class is created because it is a static attribute of some Hibernate managed classes.
4.) The BusinessCalender wants to load its configuration in the constructor, calling JbpmConfiguration.Configs.getString("resource.business.calendar")
5.) This results in a JbpmConfiguration.getInstance() because the jbpm configurations isn't yet loaded (should be done by Spring AFTER the Hibernate stuff is loaded). This creates a JbpmConfiguration with default properties which nobody wants to have.
Here the code (JbpmConfiguration class)
| public abstract static class Configs {
| public static ObjectFactory getObjectFactory() {
| ObjectFactory objectFactory = null;
| JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
| if (jbpmContext!=null) {
| objectFactory = jbpmContext.objectFactory;
| } else {
| objectFactory = getInstance().objectFactory;
| }
| return objectFactory;
| }
|
Got the problem?
I think the "fallback" to getInstance() if no current jbpmContext is found shouldn't be there, looks like some workaround or hack to me. If it is removed it forces us to develop in such a way, that nothing needs a JbpmContetx too early. Or what do you guys think? Or maybe there was a reason for this? Tom, do you remember maybe?
The fix for the the BusinessCalender is to really lazy load the properties, so the problem should go away there.
For the moment I will change the BusinessCalender to lazy load stuff and will wait for feedback... Since configuration is done differently in the PVM, I am not sure if it is worth to put effort in this for jbpm 3.2.x...
Cheers
Bernd
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158259#4158259
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158259
16 years, 5 months
[Design of POJO Server] - [jboss-metadata] Cannot get at DeploymentSummary set in Mapp
by ALRubinger
Issue is:
http://jira.jboss.com/jira/browse/JBMETA-58
The MappedReferenceMetadataResolverDeployer, in "mapEjbs", sets a DeploymentSummary in JBossMetaData, where the underlying implementation is the JBossMetaDataWrapper.
However, when attempting to obtain the DeploymentSummary in JBossEnterpriseBeanMetadata.determineResolvedJndiName(), the summary returned is that from the wrapped object, not the wrapper itself. Far as I can tell, the intention is for the wrapper to provide a read-only view.
So I cannot get at the CL required to create a DefaultJndiBindingPolicy:
// Obtain the Deployment Summary
| DeploymentSummary dsummary = getJBossMetaData().getDeploymentSummary(); //This returns the wrapped metadata's summary, not the wrapper's one which was set in the deployer
|
| // Initialize the Default JNDI Binding Policy
| DefaultJndiBindingPolicy policy = null;
|
| // If Deployment Summary is defined
| if (dsummary != null)
| {
| try
| {
| /*
| * Create a JNDI Policy from the Deployment Summary
| */
|
| // Obtain the JNDI Policy Class Name
| String jndiPolicyClassName = this.getJndiBindingPolicy();
| if (jndiPolicyClassName != null && jndiPolicyClassName.trim().equals(""))
| {
| jndiPolicyClassName = null;
| }
|
| // Get the CL
| ClassLoader loader = dsummary.getLoader(); //Here's where I need the correct CL
|
| // Load the Class
| Class<? extends DefaultJndiBindingPolicy> jndiPolicyClass = null;
| if (jndiPolicyClassName != null)
| {
| Class<?> clazz = loader.loadClass(jndiPolicyClassName);
| assert DefaultJndiBindingPolicy.class.isAssignableFrom(clazz) : "Specified " + jndiPolicyClassName
| + " is not of expected type " + DefaultJndiBindingPolicy.class.getName();
| jndiPolicyClass = (Class<? extends DefaultJndiBindingPolicy>) clazz;
| }
|
| // Create Policy
| policy = createPolicy(loader, jndiPolicyClass);
| }
| catch (Exception e)
| {
| }
| }
How can I resolve this without breaking the intention of the Wrapper to provide a read-only view?
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158227#4158227
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158227
16 years, 5 months