[Design of JBossCache] - Re: JBoss Cache and JBoss MC
by adrian@jboss.org
For doing a bootstrap:
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/trunk/bootstrap/src/ma...
But I don't really get what your requirements are?
Why would you create a kernel for every cache?
In JBossAS we would want to inject the Cache[Factory] configured
via a JBoss deployment, e.g. deploy/jbossas-cache-beans.xml
We wouldn't want a seperate kernel.
More likely we want a cache specific schema that makes it easier to configure.
e.g. something like
| @JAXBAnnotationsHere
| public Cache implements BeanMetaDataFactory
| {
| @XmlAttribute/Element(...)
| public setSomeProperty(...)
|
| List<BeanMetaData> getBeans()
| {
| // NOTE: This can be multiple beans
| return createTheEquivalentMetaDataForOurProperties();
| }
| }
|
Then we can do:
| <deployment xmlns="urn:jboss-bean-deployer:2.0">
|
| <!-- This gets converted to the BeanMetaData by the BeanMetaDataFactory above -->
| <cache xmlns="urn:jboss-cache:x.y">
| <some-property>blah</some-property>
| </cache>
| </deployment>
|
Instead of
| <deployment xmlns="urn:jboss-bean-deployer:2.0">
| <bean name="Cache" class="org.jboss.cache.UserShouldntHavetoKnowThis">
| <property name="someProperty">blah</property>
| </cache>
| </deployment>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074804#4074804
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074804
18 years, 7 months
[Design of JBossCache] - Re: JBoss Cache and JBoss MC
by alesj
"manik.surtani(a)jboss.com" wrote : Hoping for an answer from the JBoss-MC guys. :-)
|
;-)
I would do it differently. :-)
First, I would have just one MC Kernel instance per CacheFactory.
If Kernel already exists - e.g. we are in JBossAS env - use that one.
This could also apply when we integrate MC into other app servers.
But if we are standalone or not yet app. server integrated, create new Kernel instance and plugin CacheFactory as a singleton bean.
And then for each -cache.cfg.xml (having your own ParserDeployer) I would create as many Configuration beans that would actually be BeanFactory and would, together with CacheFactory, instantiate Cache instance on createBean invocation - which would also mean that that would apply create, start methods invocations.
Or something like this:
You already have CachaFactory present.
Then for each -cache.cfg.xml install new Configuration bean and new Cache bean. But the Cache bean would have MANUAL mode, meaning you would move it though MC states by calling create, start on somesort of wrapper that would delegate these calls to MC's Controller.
Does this make sense?
For standalone you would use BasicBootstrap or StandaloneBootstrap, it depends which suites you best.
And stopping the MC would be done when you stop CacheFactory instance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074801#4074801
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074801
18 years, 7 months
[Design of JBossCache] - JBoss Cache and JBoss MC
by manik.surtani@jboss.com
Now that we're finally up and running with our new SVN repo and new set of maven scripts, I'm about to get started with the MC and just wanted to run a few things by everyone.
Keeping in mind that JBC is meant to be a standalone product, for use within the AS, or in other app servers, or even in a standalone case (e.g., in a standalone java program), I'm thinking of the best way to do this wrt. MC integration.
The usual way for people to use the cache is to create one using the cache factory:
1: CacheFactory cf = DefaultCacheFactory.getInstance();
2: Cache c = cf.createCache(Configuration cfg); // cfg is a pojo that contains getters and setters for the various cfgs
3: c.create();
4: c.start();
So what I think is:
1. MC kernel is "created" when the cache factory creates the cache (line 2), with default values in jboss-beans.xml overridden with some values from cfg.
2. MC starts when cache.create() is called, and this instantiates and injects necessary beans.
3. MC stops when c.destroy() is called
Does this make sense? Am I on the right path here? If so, what would I use - for the above steps? BasicBootstrap?
Hoping for an answer from the JBoss-MC guys. :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074795#4074795
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074795
18 years, 7 months
[Design of JBoss Build System] - Re: Using jdocbook
by nbhatia
Steve, I have now switched to the jdocbook-style plugin. However the docs are not clear on how the two plugins work together. A simple example would be very helpful.
Anyway I have setup two maven projects right now: 1) andromda-docbook-style and 2) andromda-tutorial-java. POMs for the two projects are shown below:
| <project xmlns="http://maven.apache.org/POM/4.0.0"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| <modelVersion>4.0.0</modelVersion>
|
| <groupId>org.andromda</groupId>
| <artifactId>andromda-docbook-style</artifactId>
| <version>3.2</version>
| <packaging>jdocbook-style</packaging>
|
| <name>AndroMDA DocBook Style</name>
| <description>AndroMDA DocBook Style</description>
|
| <build>
| <plugins>
| <plugin>
| <groupId>org.jboss.maven.plugins</groupId>
| <artifactId>maven-jdocbook-style-plugin</artifactId>
| <extensions>true</extensions>
| </plugin>
| </plugins>
| </build>
|
| <repositories>
| <repository>
| <id>jboss</id>
| <name>JBoss Repository</name>
| <url>http://repository.jboss.org/maven2</url>
| </repository>
| </repositories>
| <pluginRepositories>
| <pluginRepository>
| <id>jboss</id>
| <name>JBoss Repository</name>
| <url>http://repository.jboss.org/maven2</url>
| </pluginRepository>
| </pluginRepositories>
|
| </project>
|
| <project xmlns="http://maven.apache.org/POM/4.0.0"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| <modelVersion>4.0.0</modelVersion>
|
| <groupId>org.andromda</groupId>
| <artifactId>andromda-tutorial-java</artifactId>
| <version>3.2</version>
| <packaging>jdocbook</packaging>
|
| <name>AndroMDA Tutorial for Java</name>
| <description>AndroMDA Tutorial for Java</description>
|
| <dependencies>
| <dependency>
| <groupId>org.andromda</groupId>
| <artifactId>andromda-docbook-style</artifactId>
| <version>3.2</version>
| <type>jdocbook-style</type>
| </dependency>
| </dependencies>
|
| <build>
| <plugins>
| <plugin>
| <groupId>org.jboss.maven.plugins</groupId>
| <artifactId>maven-jdocbook-plugin</artifactId>
| <version>2.0.0</version>
| <extensions>true</extensions>
| <configuration>
| <sourceDocumentName>Master.xml</sourceDocumentName>
| <formats>
| <format>
| <formatName>pdf</formatName>
| <stylesheetResource>classpath:/xslt/fopdf.xsl</stylesheetResource>
| <finalName>andromda-tutorial-java.pdf</finalName>
| </format>
| <format>
| <formatName>html</formatName>
| <stylesheetResource>classpath:/xslt/html.xsl</stylesheetResource>
| <finalName>index.html</finalName>
| </format>
| </formats>
| <options>
| <xincludeSupported>false</xincludeSupported>
| </options>
| </configuration>
| </plugin>
| </plugins>
| </build>
|
| <repositories>
| <repository>
| <id>jboss</id>
| <name>JBoss Repository</name>
| <url>http://repository.jboss.org/maven2</url>
| </repository>
| </repositories>
| <pluginRepositories>
| <pluginRepository>
| <id>jboss</id>
| <name>JBoss Repository</name>
| <url>http://repository.jboss.org/maven2</url>
| </pluginRepository>
| </pluginRepositories>
|
| </project>
|
The andromda-docbook-style project runs fine. It packages my style sheets in a jar under /xslt. However when I run andromda-tutorial-java, I get the following error. What am I doing wrong?
| [INFO] Scanning for projects...
| [INFO] ----------------------------------------------------------------------------
| [INFO] Building AndroMDA Tutorial for Java
| [INFO] task-segment: [install]
| [INFO] ----------------------------------------------------------------------------
| [INFO] [jdocbook:resources]
| [INFO] unpacking dependency resource [D:\m2\repository\org\andromda\andromda-docbook-style\3.2\andromda-docbook-style-3.2.jdocbook-style] to staging-dir [D:\ProjectsTest\DocBook\andromda-tutorial-java\target\staging]
| [INFO] Expanding: D:\m2\repository\org\andromda\andromda-docbook-style\3.2\andromda-docbook-style-3.2.jdocbook-style into D:\ProjectsTest\DocBook\andromda-tutorial-java\target\staging
| [INFO] [jdocbook:generate]
| [INFO] ------------------------------------------------------------------------
| [ERROR] FATAL ERROR
| [INFO] ------------------------------------------------------------------------
| [INFO] could not locate resource [classpath:/xslt/fopdf.xsl]
| [INFO] ------------------------------------------------------------------------
| [INFO] Trace
| java.lang.IllegalArgumentException: could not locate resource [classpath:/xslt/fopdf.xsl]
| at org.jboss.maven.plugins.jdocbook.gen.util.ResourceHelper.requireResource(ResourceHelper.java:31)
| at org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler.resolveTransformationStylesheet(BasicFormatHandler.java:189)
| at org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler.buildTransformer(BasicFormatHandler.java:165)
| at org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler.render(BasicFormatHandler.java:126)
| at org.jboss.maven.plugins.jdocbook.GenerationMojo.process(GenerationMojo.java:95)
| at org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.execute(AbstractDocBookMojo.java:207)
| at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
| at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
| at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
| at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
| 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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
| at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
| at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
| at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
|
Note: I think usage.apt for jdocbook-style plugin has a typo:
| <project>
| <groupId>com.mygroup</groupId>
| <artifact>myproject</artifactId>
| <type>jdocbook-style</type>
| ...
| </project>
|
Shouldn't the "type" element be replaced by
| <packaging>jdocbook-style</packaging>
|
"type" element is valid only in a dependency.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074652#4074652
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074652
18 years, 7 months