[Design of JBossCache] - JBCACHE-941 discussion
by genman
http://jira.jboss.com/jira/browse/JBCACHE-941
>From the issue:
anonymous wrote : The java.util.Collections utility class supplies useful methods for dealing with legacy interfaces and wrapping collection classes for concurrency, type safety, read-only, etc.
|
| In a simiilar vein, I wrote a "Caches" class that returns java.util.Map instances for a Node, which allow data to be modified through the standard Map interface.
|
| This I expect to be extremely useful for allowing uses to integrate their existing application with JBoss Cache, and will eliminate some of the confusion of using a new API and they can use the API they know best. Users also often demand an API which is "generic" so that their code is not tied to a particular vendor.
|
| There are basically two methods in Caches, one looks like this:
|
| Cache cache = DefaultCacheFactory.getInstance().createCache();
| Map m = Caches.asMap(cache);
| m.put("foo", "bar");
|
| The API and examples explain themselves.
|
| "Caches" could also include other useful methods for printing or reporting.
|
| Note that this functionality could be considered duplicated from PojoCache...
|
Here is one method:
/**
| * Returns a {@link Map}, where map keys are named children of the given Node,
| * and values are kept under a single key for this node.
| * The map may be safely concurrently modified through this Map or externally,
| * and its contents reflect the cache state and
| * existing data of the Node.
| * This means that {@link ConcurrentModificationException} is never thrown
| * and all methods are thread safe.
| * <p/>
| * The map is not serializable.
| * <p/>
| * Usage note: As a single node is used for every key, it is most efficient to store
| * data for a single entity (e.g. Person) in a single object.
| * <p/>
| * Also, when using a {@link CacheLoader} for storage, keys used must be valid as
| * part of the {@link Fqn} used in calls. Generally speaking, simple string values are
| * preferred.
| */
Manik suggests also an adaptor for JCache (JSR-107).
Actually, it might also be nifty if JBoss Cache could supply adaptors for competing Cache APIs. I'm not sure of the legality of this for commercially published interfaces.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003959#4003959
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003959
19 years, 2 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Non connected remoting clients throwing java.lang.Except
by clebert.suconic@jboss.com
Another place where remoting is throwing java.lang.Exception:
java.lang.Exception: Error setting up client lease.
| at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:388)
| at org.jboss.remoting.Client.setupClientLease(Client.java:521)
| at org.jboss.remoting.Client.connect(Client.java:430)
| at org.jboss.remoting.Client.connect(Client.java:420)
| at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:99)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.invoke(ClientConnectionFactoryDelegate.java:200)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.java)
| at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:86)
| at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.java)
| at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:71)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.java)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003941#4003941
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003941
19 years, 2 months
[Design the new POJO MicroContainer] - Re: serializable KernelDeployment
by bill.burke@jboss.com
Very simple testcase to reproduce:
| <deployment xmlns="urn:jboss:bean-deployer:2.0">
| <bean name="Two" class="org.jboss.embedded.test.SimpleBean">
| <property name="kernel">
| <inject bean="jboss.kernel:service=Kernel"/>
| </property>
| </bean>
| </deployment>
|
|
Upon validation I get:
| Exception in thread "main" java.lang.IllegalStateException: Incompletely deployed:
|
| *** DEPLOYMENTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
| Two -> jboss.kernel:service=Kernel{Configured:**ERROR**}
|
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:252)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:163)
| at org.jboss.embedded.test.BeanCompilerTester.deploy(BeanCompilerTester.java:65)
| at org.jboss.embedded.test.BeanCompilerTester.main(BeanCompilerTester.java:101)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003915#4003915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003915
19 years, 2 months