[EJB/JBoss] - Re: Scheduler vs. EJB Timer Service
by torf
Hi,
this is our Schedulable implementation:
| package de.mobilcom.messenger.scheduler;
|
| public class TimedObjectSchedulableRemote implements Schedulable {
| private String sRemoteHomeName;
| private our.company.framework.timer.TimedObjectRemote rTimedObject;
|
| // will be invoked by jboss with configured arg "ejb/MySchedulerTimer"
| public TimedObjectSchedulableRemote(String sRemoteHomeName) {
| this.sRemoteHomeName = sRemoteHomeName;
| }
|
| public void perform(Date rDate, long nValue) {
| try {
| if (rTimedObject == null) {
| // get MySchedulerTimer SLSB's home
| Context rInitialContext = new InitialContext();
| Object rHome = rInitialContext.lookup(sRemoteHomeName);
|
| // call rHome.create() via refection to obtain remote SLSB instance
| Method rMethod = rHome.getClass().getDeclaredMethod("create", new Class[0]);
| rTimedObject = (our.company.framework.timer.TimedObjectRemote)
| rMethod.invoke(rHome, new Object[0]);
| }
|
| // call SLSB business method
| rTimedObject.onTimeout();
| }
| catch (Exception eEx) {
| ... // logging
| rTimedObject = null; // reset invalid timed object reference
| }
| }
| }
|
Every SLSB intended for invocation via Scheduler implements interface our.company.framework.timer.TimedObjectRemote whose only method is void onTimeout() throws RemoteException.
HTH,
Christoph
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000869#4000869
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000869
19 years, 3 months
[JBoss Seam] - Re: Problem with SelectItems !!
by Giordacchio++
(sorry for my previous post....)
Hi, I'm having a problem implementing a multiple choice using a selectManyListbox:
| <h: selectManyListbox value="#{foo.selectedUsers}" id="usersList">
|
| <si:selectItems value="#{fooUsers}" var="tt" label="#{tt.username}"
| config="#{mySelectItemsConfig}" />
|
| <si:convertEntity entityClass="it.mypackage.model.User" />
|
| </h:selectManyListbox>
|
Where:
-User is an entity
-fooUsers is a List (outjected) of entities User inside the bean foo
-selectedUsers is a List of entities User inside the bean foo
-I have done the override of the equals method into my entity.
When, pressing a button the page is submitted and a "validation error" is shown :-(
The strange thing is that all works fine if I use a selectOneMenu that has not a multiple selection......where is the tricky error ?? any suggestion ?
Thx...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000868#4000868
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000868
19 years, 3 months
[JBoss Portal] - Singout
by thanvi
Hi,
I need to invoke an portlet which is in a different war, when the user clicks on the logout link in the user portlet.
I tried the following code to logout from the Portlet by doing a sendRedirect after the signout happens as below
String locationURL = req.getParameter("locationURL");
| if(locationURL != null){
| resp.signOut(locationURL);
| } else {
| resp.signOut();
| }
| PortalNode thisNode2 = req.getPortalNode().getParent();
| PortalNode linkToNode2 = thisNode2.resolve("../TestPortlet");
| PortalNodeURL pageURL2 = resp.createRenderURL(linkToNode2);
| resp.sendRedirect(pageURL2+"/TestPortletWindow?action=2");
This works fine, but after signout points to the TestPortlet page.
So I moved the code before signout as below.
But now the request is not going to the TestPortlet, instead only the signout in the portal happens
String locationURL = req.getParameter("locationURL");
| PortalNode thisNode2 = req.getPortalNode().getParent();
| PortalNode linkToNode2 = thisNode2.resolve("../TestPortlet");
| PortalNodeURL pageURL2 = resp.createRenderURL(linkToNode2);
| resp.sendRedirect(pageURL2+"/TestPortletWindow?action=2");
| if(locationURL != null){
| resp.signOut(locationURL);
| } else {
| resp.signOut();
| }
Can anyone let me know why this happens and how to resolve.
Also i am not getting the Window url when i do a createRenderURL
Please Help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000861#4000861
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000861
19 years, 3 months
[JBoss Seam] - Re: @Startup problems
by PeterReilly
Yes, I have just got the following working:
- I had to make a Stateful bean, a POJO
didi not seem to work.
package com.mydomain;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Startup;
@Scope(ScopeType.APPLICATION)
@Name("sbean2")
@Stateful
@Startup
public class SBean2 implements S2 {
@PersistenceContext
private EntityManager entityManager;
@Create
public void start() {
System.out.println("---------------------------");
System.out.println("-- --");
System.out.println("-- Starting sbean2 --");
System.out.println("-- --");
System.out.println("---------------------------");
System.out.println("entity manager is " + entityManager);
}
@Remove @Destroy
public void end() {
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000854#4000854
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000854
19 years, 3 months