[infinispan-issues] [JBoss JIRA] (ISPN-3695) Atomic Object Factory

Pierre Sutra (JIRA) issues at jboss.org
Mon Jan 12 11:44:49 EST 2015


     [ https://issues.jboss.org/browse/ISPN-3695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre Sutra updated ISPN-3695:
-------------------------------
    Description: 
This feature implements a factory of atomic objects. The factory is universal in the sense that it can instanciate an object of any class. Below, we illusrate the usage of such a factory.

AtomicObjectFactory factory = new AtomicObjectFactory(c1); // c1 is both synchronous and transactional
Set set = (Set) factory.getOrCreateInstanceOf(HashSet.class, "k"); // k is the key to store set inside c1
set.add("smthing"); // some call examples
System.out.println(set.toString())
set.addAll(set);
factory.disposeInstanceOf(HashSet.class, "set", true); // to store in a persistent way the object

The implementation requires that all the arguments of the methods of the object are Serializable, as well as the object itself.  The factory  is built on top of the transactional facility of Infinispan. When an object is created, it stores both a local copy and a proxy registered as a cache listener. Then, it serializes every call in a transaction consisting of a single put operation. When the call is de-serialized its applied to the local copy and, in case the calling process was local, the resoibse value is returned to the caller. 


  was:
This feature implements a factory of atomic objects. The factory is universal in the sense that it can instanciate an object of any class. Below, we illusrate the usage of such a factory.

AtomicObjectFactory factory = new AtomicObjectFactory(c1); // c1 is both synchronous and transactional
Set set = (Set) factory.getOrCreateInstanceOf(HashSet.class, "k"); // k is the key to store set inside c1
set.add("smthing"); // some call examples
System.out.println(set.toString())
set.addAll(set);
factory.disposeInstanceOf(HashSet.class, "set", true); // to store in a persistent way the object

The implementation requires that all the arguments of the methods of the object are Serializable, as well as the object itself.  The factory  is built on top of the transactional facility of Infinispan. When an object is created, it stores both a local copy and a proxy registered as a cache listener. Then, it serializes every call in a transaction consisting of a single put operation. When the call is de-serialized its applied to the local copy and, in case the calling process was local, the return value is returned (this mechanism is implemented via a future object).




> Atomic Object Factory
> ---------------------
>
>                 Key: ISPN-3695
>                 URL: https://issues.jboss.org/browse/ISPN-3695
>             Project: Infinispan
>          Issue Type: Feature Request
>          Components: Core
>    Affects Versions: 6.0.0.Final
>            Reporter: Pierre Sutra
>            Priority: Optional
>              Labels: atomic
>   Original Estimate: 1 week, 2 days
>  Remaining Estimate: 1 week, 2 days
>
> This feature implements a factory of atomic objects. The factory is universal in the sense that it can instanciate an object of any class. Below, we illusrate the usage of such a factory.
> AtomicObjectFactory factory = new AtomicObjectFactory(c1); // c1 is both synchronous and transactional
> Set set = (Set) factory.getOrCreateInstanceOf(HashSet.class, "k"); // k is the key to store set inside c1
> set.add("smthing"); // some call examples
> System.out.println(set.toString())
> set.addAll(set);
> factory.disposeInstanceOf(HashSet.class, "set", true); // to store in a persistent way the object
> The implementation requires that all the arguments of the methods of the object are Serializable, as well as the object itself.  The factory  is built on top of the transactional facility of Infinispan. When an object is created, it stores both a local copy and a proxy registered as a cache listener. Then, it serializes every call in a transaction consisting of a single put operation. When the call is de-serialized its applied to the local copy and, in case the calling process was local, the resoibse value is returned to the caller. 



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the infinispan-issues mailing list