Branch 2.2 will be frozen on Wednesday 2010-07-28
by Marek Novotny
All,
I will start to prepare 2.2.1.CR2 release on Wednesday 2010-07-28. I
will sent short notice about it.
After that my notice, 2.2 branch will be frozen until I create the tag
for 2.2.1.CR2.
Thanks for respecting it,
--
Marek Novotny
--
Seam Product Lead
Red Hat Czech s.r.o.
Purkynova 99
612 45 Brno
Email: mnovotny(a)redhat.com
Office phone: +420 532 294 287, ext. 82-62 087
mobile: +420 608 509 230
14 years, 4 months
Seam Faces and replacing pages.xml
by Stuart Douglas
I have been thinking about the replacement for pages.xml and this is what I have come up with.
I think we need some kind of a hierarchal data store based on view id's, where the data is stored as annotations:
public class ViewDataStore
{
/**
* Adds data to the store.
*/
public <T extends Annotation> void addData(String path, T data);
/**
* Returns all data for the path in order from most specific to least specific. e.g. if the path is /app/data/MyScreen.xhtml then it will return data for
* /app/data/MyScreen.xhtml
* /app/data/*
* /app/*
* /*
* assuming all of the above have been placed in the store via addData()
*/
public <T extends Annotation> List<T> getAllDataForPath(String path, Class<T> dataType );
/**
* returns the most specific data for the given path.
*/
public <T extends Annotation> T getDataForPath(String path, Class<T> dataType);
}
This could then be configured in a variety of ways, with enum and xml support availible out of the box:
@ViewData
public enum SomeEnum
{
@View("/app/data/*")
@LoginRequired(true)
@SeamManagedTransaction(ENABLED)
APP_DATA,
@View("/app/data/public/*")
@LoginRequired(false)
APP_DATA_PUBLIC;
}
I have not really though about the xml format yet, but it would probably use seam-xml. We could also add support for the legacy pages.xml format.
Modules would be able to use this data as follows:
@Inject ViewDataStore data;
public void checkSecurity(String currentViewId, boolean loggedIn)
{
LoginRequired required = data.getDataForPath(currentViewId, LoginRequired.class);
if(required != null)
{
if(required.value() && !loggedIn)
{
throw new NotLoggedInException();
}
}
}
This API will probably need to be tweaked a bit, e.g. I would probably add some producers that let you inject the metadata for the current view directly, but this should be enough to give a general idea of what I am proposing.
I think this approach has a number of things going for it:
It is extensible, so if a 3rd party module or user code needs to store metadata about a view they can use the same mechanism as the official seam modules.
It uses annotations to store the data, which fits in very well with configuration via annotations rather than xml.
It allows for programmatic configuration and does not tie you to a specific configuration method
Does this sound like a good idea?
Stuart
14 years, 4 months
seamframework.org changes
by Shane Bryzak
Hey guys,
I've finished working on the enhancements to the wiki software so that
we can deal easier with spam. Here's a list of the changes that have
been made.
1) Added a 'Report as spam' button to the comments section of all
document pages - this includes all FAQ and knowledge base pages, however
not forum topics. I decided not to add it to the forums because
anything posted there goes to the mailing list (which has many eyes
watching it), so I thought it was unnecessary. Clicking this button
simply creates a record in the new database table called
WIKI_SPAM_REPORT, it does not affect the display of the comment at all.
2) Added a 'Spam reports' tab to the Admin screen. This displays a list
of all the comments that have been reported as spam, the user who made
the report and the user who posted the comment. From here, you can
either delete the comment, or mark it as not spam which will remove all
spam reports for that comment.
3) Added a 'Nuke' button to the user edit page. This button deletes the
user and all their comments, topics, etc - basically any content they
have posted to the site. This is a *proper* delete (the normal delete
just re-assigns ownership of all posts to the admin user) so use with
care! This action will also blacklist the user's e-mail address and IP
address. The IP address is recorded the first time the user registers.
4) Added a 'Blacklist' tab to the Admin screen. This lists all the
records in the blacklist table, and gives the option to remove
individual records. Users with an e-mail address or IP address that's
on the blacklist are not able to register new accounts, instead they are
presented with a 'you have been blacklisted' message.
I'm pretty much ready to roll this out to production, however I would
ideally like if we could test the changes more thoroughly in some kind
of staging environment. The wiki software is quite complex and I cannot
be 100% certain that my changes haven't broken or in some way affected
some obscure feature that isn't readily detectable in basic testing. Do
we have an environment where we can set this up and test it for a few
days before deploying to production?
Also it would be nice to give the upgrade a couple of test runs to make
sure all DDL scripts etc are without error.
Shane
14 years, 4 months
Project meeting cancelled today
by Pete Muir
All,
Apologies for the late notice, but due to a scheduling mishap, we have to cancel the project IRC meeting today.
Normal time next week!
Pete
14 years, 4 months
Weld-trunk-incontainer-jboss-6.0.0.M3 failing
by Martin Gencur
Hi Pete/others,
since build 59 CDI-TCK testsuite in this job
( http://hudson.qa.jboss.com/hudson/job/Weld-trunk-incontainer-jboss-6.0.0.... ) is failing with beforeSuite(org.jboss.jsr299.tck.tests.lookup.injection.any.AnyInjectionTest) so all the tests are skipped.
The whole stacktrace is below
Martin
java.io.IOException
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.setup(ProfileServiceConnector.java:57)
at org.jboss.testharness.AbstractTest.beforeSuite(AbstractTest.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:609)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:421)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:158)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:89)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:284)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: java.lang.RuntimeException: java.io.InvalidClassException: org.jboss.profileservice.spi.ProfileKey; local class incompatible: stream classdesc serialVersionUID = 2, local class serialVersionUID = 1
at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:314)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:118)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:212)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
Caused by: java.io.InvalidClassException: org.jboss.profileservice.spi.ProfileKey; local class incompatible: stream classdesc serialVersionUID = 2, local class serialVersionUID = 1
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:309)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:118)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:212)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:216)
at org.jboss.remoting.Client.invoke(Client.java:1961)
at org.jboss.remoting.Client.invoke(Client.java:804)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aop.generatedproxies.AOPProxy$1.loadProfile(AOPProxy$1.java)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.initDeploymentManager(ProfileServiceConnector.java:181)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.setup(ProfileServiceConnector.java:53)
at org.jboss.testharness.AbstractTest.beforeSuite(AbstractTest.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:609)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:421)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:158)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:89)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:284)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aop.generatedproxies.AOPProxy$1.loadProfile(AOPProxy$1.java)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.initDeploymentManager(ProfileServiceConnector.java:181)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.setup(ProfileServiceConnector.java:53)
at org.jboss.testharness.AbstractTest.beforeSuite(AbstractTest.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:609)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:421)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:158)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:89)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:284)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: java.lang.RuntimeException: java.io.InvalidClassException: org.jboss.profileservice.spi.ProfileKey; local class incompatible: stream classdesc serialVersionUID = 2, local class serialVersionUID = 1
at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:314)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:118)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:212)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
Caused by: java.io.InvalidClassException: org.jboss.profileservice.spi.ProfileKey; local class incompatible: stream classdesc serialVersionUID = 2, local class serialVersionUID = 1
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:309)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:118)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:212)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:216)
at org.jboss.remoting.Client.invoke(Client.java:1961)
at org.jboss.remoting.Client.invoke(Client.java:804)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aop.generatedproxies.AOPProxy$1.loadProfile(AOPProxy$1.java)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.initDeploymentManager(ProfileServiceConnector.java:181)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.setup(ProfileServiceConnector.java:53)
at org.jboss.testharness.AbstractTest.beforeSuite(AbstractTest.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:609)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:421)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:158)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:89)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:284)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aop.generatedproxies.AOPProxy$1.loadProfile(AOPProxy$1.java)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.initDeploymentManager(ProfileServiceConnector.java:181)
at org.jboss.testharness.integration.jbossas.ProfileServiceConnector.setup(ProfileServiceConnector.java:53)
at org.jboss.testharness.AbstractTest.beforeSuite(AbstractTest.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:609)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:421)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:158)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:89)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:284)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
14 years, 4 months
Automatic proxying of interfaces in weld extensions
by Stuart Douglas
After some discussions with Walter White I have added some experimental code to weld extensions to enable the automatic proxying of interfaces.
To demonstrate how this works, here is a sample:
@AutoProxy(QueryInvocationHandler.class)
public interface QueryService<T> {};
public interface UserQuery extends QueryService<User>
{
@Query("select u from user u where u.username=:1")
public User findUserByUsername(String username);
}
public class QueryInvocationHandler implements InvocationHandler
{
@Inject EntityManager entityManager;
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
//run the query based on the annotations on the method
}
}
Any interface that extends QueryService will be automatically proxied by the container, using the InvocationHander specified in the @AutoProxy annotation. This proxy is registered as a bean, and if any qualifiers are present on the Interface being proxied these are added to the bean. It is also possible to inject into the InvocationHandler.
I also plan to make @AutoProxy a meta annotation, so the above could also be represented as:
@AutoProxy(QueryInvocationHandler.class)
public @interface QueryService{}
@QueryService
public interface UserQuery
{
@Query("select u from user u where u.username=:1")
public User findUserByUsername(String username);
}
Does all this sound ok, or does it not have a strong enough use case to include it in Weld Extensions?
Stuart
14 years, 4 months