[webbeans-dev] CDI Quartz Extension and SE Example
by Peter Royle
Hi,
I know you're all really busy right now with the spec updates, but
I've got a new extension for possible inclusion into WebBeans, plus a
new example app for SE which uses it.
== Quartz Extension ==
WebBeans-Quartz.zip
The extension is a Quartz extension. It basically fires events @Every
Second, @Every Minute and @Every Hour, which can be observed like so:
public void updateSomething(@Observes @Every Hour hour) { // blah }
On startup the extension first checks for the presence of observers
for each type of event and if there are no observers for a particular
type of event, no events will be scheduled.
I intend to extend it by:
1) introducing a way to define arbitrary schedules (in annotations or
in a properties file which is then referenced by name in an annotation
- which can then be made typesafe by subclassing the annotation). Eg:
package org.jboss.webbeans.extension.scheduler;
public @interface Scheduled {
String name();
}
-----------
public @interface AfterHours extends Scheduled{
String name() default "afterHours";
}
-----------
schedule.properties:
afterHours=0 1 * * * *
-----------
public void batchProcess(@Observes @AfterHours Schedule schedule)
{ ... }
2) Adding whatever is necessary to make this usable in EE environment.
Any pointers?
3) Any other suggestions?
== Memory Graph Example ==
MemoryGrapher.zip
This is another Swing based example, which renders a graph of the VM's
free memory, updating every second and calling garbage collection
every minute using the above extension. It's a nice concise example of
how to bootstrap and shutdown SE, how to observe events and how to use
the injectable logger. Plus everyone loves a pretty graph!
I know there is some obvious clean up work required, and maybe
removing the name Quartz (?) - which I'm happy to do prior to checking
in.
What do you think?
Pete.
15 years, 3 months
[webbeans-dev] Replacement pattern for Manager.getInstanceByType
by Clint Popetz
>From what I can tell, code that used to do:
manager.getInstanceByType(clazz)
now need to do:
manager.getReference(manager.getBeans(clazz).iterator().next(),clazz);
(plus checking that the set contains only one element and throwing an
exception if not.)
Is that really true? Is there no more direct way to obtain this in the
SPI? It seems like a pretty common case. If not, I can have a utility
method to do the above in the core, as many things don't cast to
ManagerImpl, so I'd rather not put it there.
-Clint
--
Clint Popetz
http://42lines.net
Scalable Web Application Development
15 years, 4 months
[webbeans-dev] Inter-module accessibility
by Pete Muir
All,
I've written up a proposal on how to address inter-module
accessibility rules. http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240819#4240819
Internally to Web Beans I plan to implement this as a BeanManager-per-
BeanDeploymentArchive, with each BeanManager able to resolve against
it's own Bean's and any that are in accessible deployment archives
using the order specified by the container. The only user-visible
stuff that will remain application wide are contexts; non-user-visible
stuff to remain application wide includes the client proxy pool,
container provided services (such as EJB integration) and the task
executor pool.
This will also have an impact on the EJB/JPA integration SPI, as it
will allow us to pass the BeanDeploymentArchive instance when
resolving EJBs/PUs/PCs and so have better knowledge of which archive
to load the bean from.
I would welcome any feedback, both on implementing this in JBoss AS,
GlassFish etc. and on whether the API can be tweaked to better reflect
Java EE application assembly. We can either discuss on the forum or
here on webbeans-dev
15 years, 4 months
[webbeans-dev] 299 API updated
by Pete Muir
All,
I've updated the 299 API to the 20090615 draft. All old methods still
used by the TCK are marked @Deprecated, and new methods in the RI are
throw new UnsupportedOperationException(). This is ahead of the TCK,
once the TCK audit is also updated we can start to remove the old
methods.
Tomorrow and over the weekend I plan to go through and start to clean
up some usage of the old methods and switch over to using the new
methods in the RI. I also will try to switch to the new deployment
events, and also implement the Annotated* stuff.
15 years, 5 months
[webbeans-dev] syntax problem in @Observes annotation
by Dan Allen
In section 10.5.4 and 10.5.6, the spec requires that the @Observes
annotation define a notify parameter which accepts the Notify enum. However,
the Java compiler does not allow an annotation to define a method named
notify().
public @interface Observes
{
Notify notify() default Notify.SYNCHRONOUSLY;
}
This annotation parameter will need to be renamed. I suggest
"notifyObserver".
public void observerMethod(@Observes(notifyObserver=IF_EXISTS) EventType
event)
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan
NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.
15 years, 5 months
[webbeans-dev] DefinitionException replacement
by Dan Allen
If the DefinitionException is no longer specified, what is the
recommend exception to throw/check for when there is a deployment
problem? I'd hate to have to write tests that simply checks for
Throwable as that would be too general.
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan
NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.
15 years, 5 months
[webbeans-dev] jboss-test-harness repository switch
by Dan Allen
Just a heads up, for anyone using the WB test infrastructure, the
jboss-test-harness was migrated from within the webbeans repository into a
repository named test-utils.
Old repo: https://svn.jboss.org/repos/webbeans/test-harness/trunk
New repo: https://svn.jboss.org/repos/test-utils/jboss-test-harness/trunk
This test harness is design to be shared by any JBoss project (or anyone
else for that matter) that wants to use it. It's extended by the TCK to add
special configuration details.
The TCK currently relies on a snapshot of the jboss-test-harness project.
Therefore, when you check out WebBeans, it's advisable that you check out
the jboss-test-harness adjacent to the ri and tck folders.
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan
NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.
15 years, 5 months
[webbeans-dev] [Fwd: Jazoon'09: BOF proposal accepted]
by Max Rydahl Andersen
FYI: emmanuel and I will be hosting a BOF on JSR-299 at Jazoon....time
and place not known yet :)
/max
-------- Original Message --------
From: Jazoon'09 Program Chair <corsin.decurtins(a)netcetera.ch>
Subject: Jazoon'09: BOF proposal accepted
To: max.andersen(a)redhat.com
Dear Max
Thank you very much for the submission of your proposal for a BOF at Jazoon'09. I am glad to announce that your proposal(s)
10240 JSR-299 Java Contexts and Dependency Injection
has/have been accepted.
Please check out the Jazoon website to find out the exact date, time and location of your BOF. Note that some BOFs are on Tuesday evening and some are on Tuesday and Wednesday afternoon, in parallel to the last session of the regular conference program.
Best regards
Corsin Decurtins
Jazoon'09 Program Chair
--
Jazoon'09 http://jazoon.com
15 years, 5 months
[webbeans-dev] stereotype restrictions removed
by Dan Allen
Is it true that the stereotype restrictions have been removed for good? I
ask because I don't see them in the spec but they are still appearing in the
RI. I'm in that area of the TCK tests and I'm trying to decide how to
approach it.
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan
NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.
15 years, 5 months