[Design of JBoss jBPM] - Re: Failure handling
by bill.burke@jboss.com
i don't think we need to do it that way tom. Wouldn't this just work with no JBPM changes?
| @MessageDriven(activationConfig= {
| ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
| ActivationConfigProperty(propertyName="messageSelector", propertyValue="jobId IS NOT NULL"),
| ActivationConfigProperty(propertyName="destination", propertyValue="queue/DLQ")})
| public class DLQFailureHandler implements MessageListener
| {
| JbpmConfiguration jbpmConfiguration = null;
| @Resource(name="JbpmCfgResource") String jbpmCfgResource = null;
|
| @PostConstruct
| public void initJbpm() {
| jbpmConfiguration = JbpmConfiguration.getInstance(jbpmCfgResource);
| }
|
| public void onMessage(Message message) {
| long jobId = 0;
| try {
| jobId = message.getLongProperty("jobId");
| } catch (JMSException ignored) {
| // message selector confirms existence
| }
|
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try {
| JobSession jobSession = jbpmContext.getJobSession();
| Job job = jobSession.loadJob(jobId);
| if (!(job instanceof ExecuteNodeJob)) {
| // do some other failure handling
| jbpmContext.close();
| return;
| }
| ExecuteNodeJob executeNodeJob = (ExecuteNodeJob)job;
| if (executeNodeJob.getNode().hasLeavingTransition("failure")) {
| executeNodeJob.getProcessInstance().signal("failure");
| jobSession.deleteJob(job);
| }
| else {
| // push to a different DLQ?
| }
| } finally {
| jbpmContext.close();
| }
| }
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070774#4070774
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070774
16 years, 9 months
[Design the new POJO MicroContainer] - Re: Need a NamedObject SimpleMetaType
by scott.stark@jboss.org
"adrian(a)jboss.org" wrote : The point I was trying to make before was that it probably be easier
| for the mangement layer to deal with a map, so an alternative markup
| might be to define on the collection:
|
|
| | @MangementObject
| | public class SecurityDeployment
| | {
| | // login-config.xml has many policies
| | @ManagedProperty(managed=true map-id="name" id-qualifier="SecurityDomain")
| | Collection<SecurityPolicy> getPolicies();
| | }
| |
|
| Then the profile service when it does getProperty("policies")
| would get a TableMetaValue of String(id/name)->ManagedObject
| instead of having to iterate over an array of managed objects.
|
Ok, the reference to the login-config.xml is interesting now in that its not exposed as metadata available to the deployment layer. Its really handled outside of the associated security mbean as internal state of a custom jaas login configuration object in the jdk. It does in fact need to be associated with the jaas security domain mbean as sub-managed objects, and the id-qualifier needs to differentiate the SecurityDomain type further as there will be alternate SecurityDomain types (jaas, jaspi, ...). A little off topic, but that is why I was not following what the SecurityPolicy annotation was achieving.
I'll try to have a revision of the management annotations by Monday to review.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070729#4070729
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070729
16 years, 9 months