[Design of POJO Server] - ProfileService/OBR repository
by scott.stark@jboss.org
I just checked in a OSGi OBR like addition to the org.jboss.profileservice.spi.repository package. The interfaces in there mirror the OSGi OBR interfaces with two additions:
1. The RepositoryAdmin has an additional Repository getRepository(URI repository) throws Exception; method.
2. There is an extension of the Repository interface that allows for addition/removal and modification detection of Resources:
| public interface MutableRepository extends Repository
| {
| /** */
| public enum ModifyStatus {ADDED, MODIFIED, REMOVED};
|
| /**
| * Add a resource to the repository.
| * @param resource the resource to add
| * @throws Exception thrown on any addition failure
| */
| public void addResource(Resource resource)
| throws Exception;
| /**
| * Remove a resource from the repository
| * @param name the resource SYMBOLIC_NAME or ID
| * @return the Resource that was removed if found, null otherwise.
| * @throws Exception thrown on any remove failure
| */
| public Resource removeResource(String name)
| throws Exception;
| /**
| * Return a collection of resources that have been modified since
| * the last call to this method. The returned resources contain
| * a modifyStatus property of type ModifyStatus to indicate the
| * type of change.
| *
| * @return The Resources that have been modified.
| * @throws Exception
| */
| public Collection<Resource> getModifiedResources()
| throws Exception;
| }
|
There are still a lot of issues to validate in terms of actually using an OBR implementation. The validation of the OBR like API is in the mapping class org.jboss.system.server.profileservice.repository.RepositoryAdminAdaptor. This maps the current org.jboss.profileservice.spi.DeploymentRepository spi onto the org.jboss.profileservice.spi.repository.RepositoryAdmin OBR like SPI. I'm going to look at using some form of the Felix 1.1 bundlerepository code(http://svn.apache.org/repos/asf/felix/trunk/bundlerepository/) for the next release.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085728#4085728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085728
18 years, 6 months
[Design of AOP on JBoss (Aspects/JBoss)] - Re: AOP asintegration WITHOUT the integration :-)
by kabir.khan@jboss.com
"adrian(a)jboss.org" wrote :
| It's not work in progress, at least not yet.
| I only added the deployments scope a week ago.
|
| I'd suggest you try it yourself with a mock test, e.g. write an aspect
| that pushes the metadata from the advisor onto the stack and test it using
| the aop proxy where you can pass in the metadata.
I've created some simple tests on my machine emulating what I think will happen at deployer level.
| public void testDomain() throws Exception
| {
| URL url = null;
| Domain domain = null;
| try
| {
| //Create our instance to be proxied before we start deploying stuff
| TestIntercepted test = new TestIntercepted();
|
| //Deployer creates metadata and populates that with the necessary domain
| createAndPushMetaData(createScopedDomain("xxx"));
|
| //We get the domain out of the metadata and deploy into that
| MetaData md = MetaDataStack.peek();
| domain = md.getMetaData(Domain.class);
| assertNotNull(domain);
| url = deploy("1", Thread.currentThread().getContextClassLoader(), domain);
|
| //create the proxy, the scoped manger is taken from the metadata stack
| AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
| params.setTarget(test);
| params.setMetaData(md);
|
| AOPProxyFactory factory = new GeneratedAOPProxyFactory();
| TestIntercepted proxy = (TestIntercepted)factory.createAdvisedProxy(params);
| assertFalse(proxy.getClass() == TestIntercepted.class);
|
| TestInterceptor.intercepted = null;
| proxy.doSomething();
| assertNotNull(TestInterceptor.intercepted);
| assertEquals("First", TestInterceptor.intercepted);
| }
| finally
| {
| if (MetaDataStack.peek() != null)
| {
| MetaDataStack.pop();
| }
| undeploy(url, domain);
| }
| }
|
| private ScopeKey createScope(String app, String dep)
| {
| ScopeKey result = ScopeKey.DEFAULT_SCOPE.clone();
| result.addScope(CommonLevels.APPLICATION, app);
| result.addScope(CommonLevels.DEPLOYMENT, dep);
| return result;
| }
|
| private void createAndPushMetaData(Domain scopedDomain)
| {
| //Deployer creates Domain depending on classloader rules, and adds it to metadata for deployment
| ScopeKey scopeKey = createScope("Test", scopedDomain.getDomainName());
| MutableMetaDataRepository repository = new BasicMetaDataRepository();
| MetaDataRetrieval retrieval = new MemoryMetaDataLoader(scopeKey);
| repository.addMetaDataRetrieval(retrieval);
|
| if (scopedDomain != null)
| {
| ((MutableMetaData)retrieval).addMetaData(scopedDomain, Domain.class);
| }
| MetaData metadata = repository.getMetaData(scopeKey);
| MetaDataStack.push(metadata);
| }
|
| private Domain createScopedDomain(String name)
| {
| AspectManager manager = AspectManager.getTopLevelAspectManager();
| Domain scopedDomain = new Domain(manager, name, false);
| return scopedDomain;
| }
|
|
I think I am missing a part in the metadata stuff. What I have pasted in above works fine for generating the proxies, but I don't see how this will work when doing weaving? What if there is no metadata on the stack? Or would that be a bug when running within JBoss. Alternatively, we would need something to map from the classloader passed in to AspectManager.translate() to the metadata, but that sounds suspiciously like a variation of what we have at the moment (classloader=>ScopedClassLoaderDomain)?
The second part of this is that the metadata is currently only really used at weaving/advisor population time. i.e we use the metadata to get the domain, and the annotations etc. to be used for the bindings etc. I think you have in mind something for the same class to have different interceptor chains invoked depending on the MetaData on the stack?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085664#4085664
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085664
18 years, 6 months
[Design of JBoss Build System] - warning: unmappable character for encoding UTF8
by ambika
Hi,
I am trying to build Jboss 4.2.0.GA on Linux Platform with following version of the java.
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)
I am getting following warnings, then its creating a file hs_err_pid4213.log by the java.
I tried with
/home/jbossjboss-eap-4.2-src/jboss-as/server/src/main/org/jboss/metadata/SessionMetaData.java:49: warning: unmappable character for encoding UTF8
* name of the session bean�s web service interface
^
/home/jbossjboss-eap-4.2-src/jboss-as/server/src/main/org/jboss/naming/java/javaURLContextFactory.java:35: warning: unmappable character for encoding UTF8
* @author Rickard �berg
^
/home/jbossjboss-eap-4.2-src/jboss-as/server/src/main/org/jboss/proxy/ejb/EJBMetaDataImpl.java:36: warning: unmappable character for encoding UTF8
* @author Rickard �berg (rickard.oberg(a)telkel.com)
^
/home/jbossjboss-eap-4.2-src/jboss-as/server/src/main/org/jboss/web/ThreadPool.java:29: warning: unmappable character for encoding UTF8
* Rickard �berg
^
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGBUS (0x7) at pc=0xb7759b43, pid=4213, tid=3086157504
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode, sharing)
# Problematic frame:
# C [libzip.so+0xbb43]
#
# An error report file with more information is saved as hs_err_pid4213.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
run: line 10: 4213 Aborted sh ./build.sh -verbose
In Linux by default LANG=en_US.UTF-8, do we need to change anything about. Did anybody faced this problem?
Thanks and Regards,
Ambika
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085663#4085663
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085663
18 years, 6 months