[JBoss AOP] - Re: aop precompiler ant task fails to find class reference
by thebaz
I add ant build task to be more clear.
<!--AOP COMPILATION-->
| <path id="cachelib.classpath">
| <fileset dir="${cache_lib}">
| <include name="**/*.jar"/>
| <exclude name="jboss-cache.jar"/>
| <exclude name="jboss-aop.jar"/>
| </fileset>
|
| <fileset dir="${cache_lib-50}">
| <include name="**/*.jar"/>
| </fileset>
| </path>
|
| <!-- set local properties for this build -->
| <path id="pojocache.lib.classpath">
| <fileset dir="${cache_lib}">
| <include name="jboss-common.jar"/>
| <include name="concurrent.jar"/>
| <include name="javassist.jar"/>
| <include name="trove.jar"/>
| </fileset>
| <fileset dir="${cache_lib-50}">
| <include name="jboss-cache-jdk50.jar"/>
| <include name="jboss-aop-jdk50.jar"/>
| </fileset>
| </path>
|
| <path id="jboss.aop.class.path">
| <fileset dir="${cache_lib}">
| <include name="jboss-aop-jdk50.jar"/>
| </fileset>
| </path>
|
| <!-- pre-compile directory with aopc -->
| <target name="aopc-cbe" description="Precompile aop classes">
| <unzip src="${basedir}/temp/${sar-filename}/gto-cbe.jar" dest="${basedir}/temp/gto-cbe"/>
| <!--<delete file="${basedir}/temp/${sar-filename}/gto-cbe.jar"/>-->
|
| <path id="cbe-user.classpath">
| <pathelement path="${basedir}/temp/${sar-filename}/*.jar"/>
| <pathelement path="${basedir}/temp/gto-cbe"/>
| <path refid="cachelib.classpath"/>
| </path>
|
| <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="pojocache.lib.classpath"/>
| <aopc compilerclasspathref="pojocache.lib.classpath" verbose="true">
| <src path="${basedir}/temp/gto-cbe"/>
| <aoppath path="${basedir}/jboss-aop.xml"/>
| <classpath refid="cbe-user.classpath"/>
| </aopc>
|
| <jar basedir="${basedir}/temp/gto-cbe" jarfile="${basedir}/temp/${sar-filename}/gto-cbe.jar">
| <patternset>
| <include name="**/*.*"/>
| </patternset>
| </jar>
| <delete dir="${basedir}/temp/${sar-filename}/gto-cbe"/>
| </target>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119585#4119585
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119585
18 years, 3 months
[JBoss Seam] - Re: Start quartz cron when Seam apps is up
by cavani
I am using this:
|
| @Name("bootstrap")
| @Scope(ScopeType.APPLICATION)
| @BypassInterceptors
| @Startup
| public class Bootstrap
| {
|
| @Create
| public void start() throws Exception
| {
| Events.instance().raiseTimedEvent("comeEvent", new CronSchedule((Long) null, "0 0 6 * * ?"));
| }
|
| @Destroy
| public void stop()
| {
| }
|
| }
|
It's working, but may not be exactly what you want.
Other way (once setted you can't get cron trigger anymore, so...):
| @Name("synchronizationTimer")
| @Scope(ScopeType.APPLICATION)
| @Startup
| public class SynchronizationTimer
| {
|
| private static final String defaultTrigger = "0 0 3 * * ?";
|
| @Logger
| private Log log;
|
| private QuartzTriggerHandle handle;
|
| private String trigger = defaultTrigger;
|
| @Create
| public void start() throws Exception
| {
| // uncomment this if you want set timer on startup
| setTrigger(defaultTrigger);
| }
|
| public void restoreDefault()
| {
| setTrigger(defaultTrigger);
| }
|
| public void setTrigger(String trigger)
| {
| try
| {
| QuartzTriggerHandle handle = QuartzDispatcher.instance().scheduleTimedEvent("someEvent", new CronSchedule((Long) null, trigger));
|
| if (this.handle != null)
| this.handle.cancel();
|
| this.handle = handle;
| this.trigger = trigger;
| }
| catch (Exception e)
| {
| log.error("Erro configurando timer: #0", e, trigger);
| }
| }
|
| public String getTrigger()
| {
| return trigger;
| }
|
| public void cancel()
| {
| try
| {
| if (handle != null)
| handle.cancel();
| handle = null;
| trigger = null;
| }
| catch (Exception e)
| {
| log.error("Erro configurando timer: #0", e, trigger);
| }
| }
|
| @Destroy
| public void stop()
| {
| cancel();
| }
|
| }
|
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119580#4119580
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119580
18 years, 3 months
[JBoss Seam] - Re: No selected element from <h:selectOneListbox>
by haefti
Hi!
First of all thanks for the answer!
"jmodadams" wrote : I believe the problem here is that you have not specified a value attribute in the h:selectOneListbox tag, which is how you bind the selected value to your backing bean.
|
| If you were to add a video property to your manager bean with a public setter method, you could then do the following:
|
Okay, I thought I could inject it via @In or @DataModelSelection or something similar.
My managerAction now looks like this:
| @Stateless
| @Name("manager")
| public class ManagerAction implements Manager{
|
| @Logger
| Log log;
|
| private Video selVideo;
|
| public Video getselVideo() {
| return selVideo;
| }
|
| public void setSelVideo(Video selVideo) {
| this.selVideo = selVideo;
| }
|
| public String editVideo () {
| log.info("selected video Id: " + selVideo.getVideoId());
| return "edit";
| }
| .
| .
| .
| }
|
the hello.xhtml contains this code:
| <h:form>
|
| <h:selectOneListbox size="10" value="#{manager.selVideo}">
| <s:selectItems value="#{videos}" var="video" disabled="#{video.videoId < 25000 ? true : false}"
| label="(#{video.datum}) #{video.videoId} - #{video.thema}: #{video.headline}" />
| <s:convertEntity />
| </h:selectOneListbox>
|
| <h:commandButton type="submit" action="#{manager.editVideo()}" value="ÃÂÃÂndern"></h:commandButton>
|
| </h:form>
|
and I added this to my pages.xml:
| <page view-id="/hello.xhtml">
|
| <navigation from-action="#{manager.editVideo}">
| <rule if-outcome="edit">
| <redirect view-id="/edit.xhtml"/>
| </rule>
| </navigation>
|
| </page>
|
but if I choose an item from the list and press the button I still get back to the hello.xhtml and do not get the log output of the editVideo() method.
If I don't choose anything and press the button I get an (expected) NullPointerException from the method editVideo() because selVideo is null can not be logged.
Any idea?
Thanks!
Haefti
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119573#4119573
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119573
18 years, 3 months