[Design the new POJO MicroContainer] - Using ClassInfo in JBoss AOP
by kabir.khan@jboss.com
We would like to start using ClassInfo in JBoss AOP, since that will get rid of the duplicated code we have in our pointcut matchers. Currently we have code doing the same thing for javassist (during weaving) and for java.lang.reflect (to populate the advisors of woven classes at runtime).
For our use the current implementation of JavassistTypeInfoFactoryImpl has a few problems:
1) From what I can see, it does not allow the specification of a javassist ClassPool to use, instead it falls back on ClassPool.getDefault(), which just gives you the stuff on the bootstrap classpath, and so will not work in AS for application classes. It should be possible to pass in the ClassPool to use, or if working out the ClassPool from the classloader, to pass in some kind of ClassPool factory so that it uses the same underlying ClassPool as AOP does.
2) We would want to use the javassist version of ClassInfo during weaving, i.e. before the classes are loaded. However, the WeakClassCache used by JavassistTypeInfoFactoryImpl seems to need to load the class:
| Thread [main] (Suspended (breakpoint at line 126 in JavassistTypeInfoFactoryImpl))
| JavassistTypeInfoFactoryImpl.instantiate(Class) line: 126
| JavassistTypeInfoFactoryImpl(WeakClassCache).get(Class) line: 67
| JavassistTypeInfoFactoryImpl.getTypeInfo(Class<?>) line: 280
| JavassistTypeInfoFactoryImpl.getTypeInfo(String, ClassLoader) line: 312
| JavassistTypeInfoFactory.getTypeInfo(String, ClassLoader) line: 54
| JavassistArrayUnitTestCase(AbstractClassInfoTest).testBasics(Class<?>, TypeInfo) line: 72
| JavassistArrayUnitTestCase(ClassInfoArrayTest).testArray(Object) line: 139
| JavassistArrayUnitTestCase(ClassInfoArrayTest).testSimpleArray() line: 46
|
So that is not good for us. We need a javassist version of ClassInfo to use during weaving that does not load the class as part of its instantiation, once woven the class can be put into the WeakClassCache.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199605#4199605
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199605
14 years, 2 months
[Design of JBoss/Tomcat Integration] - Re: JBIDE-3394, hot deployment management api
by emuckenhuber
"max.andersen(a)jboss.com" wrote : any example that does not require days spent in reverse engineering AS 5 testsuite to figure out how this remote deployment works and what the minimal dependencies are ? ;)
|
The minimal dependencies for compiling is quite easy:
| <dependency>
| <groupId>org.jboss.integration</groupId>
| <artifactId>jboss-profileservice-spi</artifactId>
| <version>5.0.3.GA</version>
| </dependency>
|
And i guess the minimal dependencies for running are something like this (plus the one above), but not really sure.
| <dependency>
| <groupId>org.jboss.naming</groupId>
| <artifactId>jnp-client</artifactId>
| </dependency>
| <dependency>
| <groupId>org.jboss.aspects</groupId>
| <artifactId>jboss-security-aspects</artifactId>
| </dependency>
| <dependency>
| <groupId>org.jboss.aspects</groupId>
| <artifactId>jboss-remoting-aspects</artifactId>
| </dependency>
|
And you get the DeploymentManager like this:
| InitialContext ctx = new InitialContext();
| ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
| dm = ps.getDeploymentManager();
| // Load the default profile
| dm.loadProfile(new ProfileKey("default"), false);
| // deploy
| ...
|
For the jndi properties you can look at: http://www.jboss.org/community/docs/DOC-10949
And one note to the ProfileKey - "default" means the -c default for the moment.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199598#4199598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199598
14 years, 2 months
[Design of JBoss Web Services] - Webservice and C lang
by RajaRamana
Hi,
I am looking for help to provide a service between J2EE and C lang.
1. I have created the following Web Service in J2EE
/*
* @WebService indicates that this is webservice interface and the name
* indicates the webservice name.
*/
@WebService(name = "Hello")
/*
* @SOAPBinding indicates binding information of soap messages. Here we have
* document-literal style of webservice and the parameter style is wrapped.
*/
@SOAPBinding
(
style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
)
public class Hello
{
/**
* This method takes a input parameter and appends "Hello" to it and
* returns the same.
*
* @param name
* @return
*/
@WebMethod
public String greet( @WebParam(name = "name")
String name )
{
return "Hello " + name;
}
}
2. Configured in web.xml
<servlet-name>Hello</servlet-name>
<servlet-class>com.carrefour.cmt.central.webservice.Hello</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/Hello</url-pattern>
</servlet-mapping>
3. Started Jboss421. After that it created a wsdl file in DATA folder.
4 Now i want to write a Client to consume the service in 'C' LANG.
Please Assist me.
Thanks and Reg,
Raja
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199526#4199526
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199526
14 years, 2 months