[jBPM Development] New message: "Re: No public metadata API?"
by Ronald van Kuijk
JBoss development,
A new message was posted in the thread "No public metadata API?":
http://community.jboss.org/message/525257#525257
Author : Ronald van Kuijk
Profile : http://community.jboss.org/people/kukeltje
Message:
--------------------------------------------------------------
Bill,
If you want access to the internal 'model', cast the Execution to OpenExecution:
> OpenExecution e = (OpenExecution)processInstance.findActiveExecutionIn(activityName);
> e.getActivity().getOutgoingTransitions();
>
No need to use internal classes then. This still has to be added to the executionService. Getting transitions was only available for the taskService.
Regarding creating xml from the definition, that is not needed:
>
> List<Deployment> dep = repositoryService.createDeploymentQuery().page(0, 10).list();
>
> for (Deployment deployment : dep) {
>
> Set<String> resources = repositoryService.getResourceNames(deployment.getId());
> for (String resource : resources) {
> // e.g. test firstif the resourcename ends with .jpdl.xml
>
> InputStream is = repositoryService.getResourceAsStream(deployment.getId(),resource);
> ...
> }
> }
>
Cheers,
Ronald
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525257#525257
16 years, 1 month
[EJB 3.0 Development] New message: "EJBTHREE-1998: TestSuite Client Dependencies from JBOSS_HOME"
by Andrew Rubinger
JBoss development,
A new message was posted in the thread "EJBTHREE-1998: TestSuite Client Dependencies from JBOSS_HOME":
http://community.jboss.org/message/525237#525237
Author : Andrew Rubinger
Profile : http://community.jboss.org/people/ALRubinger
Message:
--------------------------------------------------------------
I've committed the patch for EJBTHREE-1998 which builds the test client classpath from artifacts under JBOSS_HOME.
Note that if libraries move around between AS targets (ie, EAP and As trunk), we'll need to continue to keep the build-test.xml paths backwards-compatible to support both.
For now the tests are coming back mostly OK I think, though the view is clouded due to CNFE on some stuff from Hibernate Core. This should be temporary; the mapper responsible for removing version numbers from JAR names in the AS build is not handling "SNAPSHOT" properly, and Hibernate in AS is now a snapshot.
Tomorrow there should be a release cut and we'll see where we stand.
S,
ALR
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525237#525237
16 years, 1 month
[jBPM Development] New message: "Re: No public metadata API?"
by Bill Burke
JBoss development,
A new message was posted in the thread "No public metadata API?":
http://community.jboss.org/message/525228#525228
Author : Bill Burke
Profile : http://community.jboss.org/people/bill.burke@jboss.com
Message:
--------------------------------------------------------------
Well, I got it to work doing this:
import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.Transition;
{...
if (instance.findActiveActivityNames().size() < 1) return;
String activityName = instance.findActiveActivityNames().iterator().next();
ProcessDefinitionImpl pd = (ProcessDefinitionImpl)engine.getRepositoryService().createProcessDefinitionQuery().processDefinitionId(instance.getProcessDefinitionId()).uniqueResult();
Activity current = pd.findActivity(activityName);
for (Transition transition : current.getOutgoingTransitions())
{...}
}
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525228#525228
16 years, 1 month
[JBoss Microcontainer Development] New message: "Re: Profiling the dependency project"
by Kabir Khan
JBoss development,
A new message was posted in the thread "Profiling the dependency project":
http://community.jboss.org/message/525227#525227
Author : Kabir Khan
Profile : http://community.jboss.org/people/kabir.khan@jboss.com
Message:
--------------------------------------------------------------
Regarding the contextsByState sets
> - Try a normal synchronized HashSet (need to make sure first that the way we use it we don't iterate over the entries)
>From what I can see, all usage within the main sources seem to be with the read/writeLock taken so we could possibly just use a plain HashSet, apart from this in AbstractContextRegistry:
> *public* Set<ControllerContext> getContextsByState(ControllerState state)
>
> {
>
> *return* controller.getContextsByState(state);
>
> }
I can't see any usage of this, so I am unsure what the consequences of exposing this would be?
Average time in ms for 10,000 contexts in the correct order:
-1850 with COWAS
-1074 with plain HashSet
Average time in ms for 500 contexts in the wrong order:
-1140 with COWAS
-1180 with plain HashSet
However since getContextsByState() is in the spi and its implemetation is straightforward we probably want some flavour of concurrent set, so I'll look at the FastCopyHashMap implementation
> *public* Set<ControllerContext> getContextsByState(ControllerState state)
>
> {
>
> *return* contextsByState.get(state);
>
> }
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525227#525227
16 years, 1 month
[Security Development] New message: "ACL Implementation Questions"
by ANIL SALDHANA
JBoss development,
A new message was posted in the thread "ACL Implementation Questions":
http://community.jboss.org/message/525225#525225
Author : ANIL SALDHANA
Profile : http://community.jboss.org/people/anil.saldhana@jboss.com
Message:
--------------------------------------------------------------
Stefan, when you look at the following class:
package org.jboss.security.acl.ACLImpl
we have
import javax.persistence.OneToMany;
import org.hibernate.annotations.Cascade;
@OneToMany(mappedBy = "acl", fetch = FetchType.EAGER, cascade =
{CascadeType.REMOVE, CascadeType.PERSIST})
@Cascade(
{org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
private Collection<ACLEntryImpl> entries;
We have two annotations on the collection of acl entries. One is a JPA annotation and the other is an Hibernate specific annotation.
The question I have is the hibernate annotation a necessity? If not, we just have a JPA dependence on the ACL implementation.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525225#525225
16 years, 1 month
[jBPM Development] New message: "Re: No public metadata API?"
by Bill Burke
JBoss development,
A new message was posted in the thread "No public metadata API?":
http://community.jboss.org/message/525223#525223
Author : Bill Burke
Profile : http://community.jboss.org/people/bill.burke@jboss.com
Message:
--------------------------------------------------------------
I guess I'm missing out to get an Activity plus how to get the transitions that are available out of the activity. I don't currently see any query api to get this information within JBPM 4.3
Currently I'm getting a "no environment to get org.jbpm.pvm.internal.session.RepositorySession" error when I do this:
engine.getExecutionService().signalExecutionById(pid);
instance = engine.getExecutionService().findProcessInstanceById(pid);
ExecutionImpl execution = (ExecutionImpl)instance;
Activity current = execution.getActivity();
getActivity() is throwing it. What I want to get at runtime is the available transitions out of the current wait state.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525223#525223
16 years, 1 month
[JBoss Microcontainer Development] New message: "Re: Profiling the dependency project"
by Kabir Khan
JBoss development,
A new message was posted in the thread "Profiling the dependency project":
http://community.jboss.org/message/525220#525220
Author : Kabir Khan
Profile : http://community.jboss.org/people/kabir.khan@jboss.com
Message:
--------------------------------------------------------------
> mailto:kabir.khan@jboss.com wrote:
>
> We do quite a lot of adding to and removing from AbstractController.installed and the sets stored in AbstractController.contextsByState. They are currently implemented as CopyOnWriteArraySets which perform badly when there are large numbers of entries in the sets already. I tried replacing these with ConcurrentSet (based on ConcurrentHashMap), but that performed worse. I've spoken to Jason who gave me a few ideas, but will put those off until I've picked off a few other things.
What I forgot to mention here is that the perfomance of these sets is related to the size. COWAS performs better than ConcurrentSet when a small number of exisiting entries are present, which probably makes it ok for the 'installing' set since that will not contain that many entries. It does however degrade its performance rapidly when there are many entries there, so it is probably not the best choice for the sets stored in 'contextsByState'.
This little test demonstrates the difference:
public class SetBenchmark
{
static int prefill = 1000;
static int iterations = 10000000;
public static void main(String[] args)
{
Set<String> set = new CopyOnWriteArraySet<String>();
// Set<String> set = new ConcurrentSet();
// Set<String> set = new HashSet<String>();
// Set<String> set = new ConcurrentSkipListSet<String>();
for (int i = 0 ; i < prefill ; i++)
{
set.add("XYZ" + i);
}
long start = System.currentTimeMillis();
for (int i = 0 ; i < iterations ; i++)
{
set.add("XXX" + i);
set.remove("XXX" + i);
}
System.out.println("-----> " + (System.currentTimeMillis() - start));
}
}
The times in ms for various amounts of prefill, COWAS, normal HashSet, ConcurrentSkipListSet and ConcurrentSet:
> prefill 0
> ------------
> COWAS: 4648 4397 4618 4430 4460
> CS: 5141 5026 5177 4908 5139
> HS: 4267 3954 3762 4070 3952
> CSLS: 5475 5504 5461 5649 5406
>
> prefill 10
> ----------
> COWAS: 6781 7026 6502 6505
> CS: 5009 4954 4791 5168
> HS: 4165 4403 4206
> CSLS: 6046 6291 6216
>
> prefill 100
> -----------
> COWAS: 29138 31600
> CS: 5115 5208 5179 5511
> HS: 4378 4525 4098 4181
> CSLS: 6836 7029 6721
>
> prefill 1000
> ------------
> COWAS: About 5 minutes
> CS: 5030 5212
> CSLS: 8488 7627 7797
> HS: 4141 4085
So this might explain why CS makes performance worse when used for contextsByState's sets, in my benchmark most states will have very few entries and only a few willl have lots of entries. CSLS always seems to be slower than CS so we won't go with that.
A few of Jason's suggestions were;
- Create own COWAS implementation based on FastCopyHashMap
- Try a normal synchronized HashSet (need to make sure first that the way we use it we don't iterate over the entries)
- ConcurrentSkipListMap although its performance degrades with performance (evaluated above)
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525220#525220
16 years, 1 month