Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/SpecialProjects"
m (→Requirements) |
m (→Projects) |
||
Line 5: | Line 5: | ||
==Projects== | ==Projects== | ||
===Projects In Development === | ===Projects In Development === | ||
+ | ====Distributed RMI==== | ||
+ | =====EE Distributed Session Bean===== | ||
+ | *Deploy this on each of your WebLogic servers | ||
+ | <source lang="java"> | ||
+ | @Stateful(mappedName="ejb/Node") | ||
+ | @Local | ||
+ | public class Node implements NodeRemote, NodeLocal { | ||
+ | private int transition; | ||
+ | private int state; | ||
+ | |||
+ | public void setState(int aState) { | ||
+ | System.out.println("_Distributed: new state: " + aState); | ||
+ | state = aState; | ||
+ | } | ||
+ | |||
+ | public int getState() { | ||
+ | return state; | ||
+ | } | ||
+ | |||
+ | public int getAdjacent(int offsetX, int offsetY) { | ||
+ | return 1; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | @Remote | ||
+ | public interface NodeRemote { | ||
+ | //####<15-Sep-2010 1:21:15 o'clock PM EDT> <Info> <EJB> <xps435> <AdminServer> <[STANDBY] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1284571275760> <BEA-010009> | ||
+ | //<EJB Deployed EJB with JNDI name org_eclipse_persistence_example_distributed_ClientEARorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home.> | ||
+ | public void setState(int state); | ||
+ | public int getState(); | ||
+ | public int getAdjacent(int offsetX, int offsetY); | ||
+ | } | ||
+ | |||
+ | </source> | ||
+ | =====SE client===== | ||
+ | *Run this on one of the servers or a separate SE JVM | ||
+ | <source lang="java"> | ||
+ | package org.eclipse.persistence.jmx; | ||
+ | |||
+ | import java.util.ArrayList; | ||
+ | import java.util.HashMap; | ||
+ | import java.util.Hashtable; | ||
+ | import java.util.List; | ||
+ | import java.util.Map; | ||
+ | |||
+ | import javax.naming.Context; | ||
+ | import javax.naming.InitialContext; | ||
+ | import javax.rmi.PortableRemoteObject; | ||
+ | |||
+ | import org.eclipse.persistence.example.distributed.NodeRemote; | ||
+ | |||
+ | /** | ||
+ | * This class tests RMI connections to multiple WebLogic servers running on | ||
+ | * remote JVM's. It is intended for experimental concurrency investigations only. | ||
+ | * @author mfobrien 20100916 | ||
+ | * | ||
+ | */ | ||
+ | public class JNDIClient { | ||
+ | public static final List<String> serverNames = new ArrayList<String>(); | ||
+ | |||
+ | private Map<String, Hashtable<String, String>> contextMap = new HashMap<String, Hashtable<String, String>>(); | ||
+ | private Map<String, Context> rmiContextMap = new HashMap<String, Context>(); | ||
+ | private Map<String, NodeRemote> remoteObjects = new HashMap<String, NodeRemote>(); | ||
+ | private Map<String, Integer> stateToSet = new HashMap<String, Integer>(); | ||
+ | private static Map<String, String> serverIPMap = new HashMap<String, String>(); | ||
+ | |||
+ | private static final String CONTEXT_FACTORY_NAME = "weblogic.jndi.WLInitialContextFactory"; | ||
+ | private static final String SESSION_BEAN_REMOTE_NAME = "ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote"; | ||
+ | //private String sessionBeanRemoteName = "java:comp/env/ejb/Node"; // EE only | ||
+ | //private String sessionBeanRemoteName = "org_eclipse_persistence_example_distributed_ClientEARorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home" ; | ||
+ | |||
+ | /** | ||
+ | * For each server add the name key and corresponding RMI URL | ||
+ | */ | ||
+ | static { | ||
+ | // Beowulf5 on Cat6 1Gb/Sec | ||
+ | serverNames.add("beowulf5"); | ||
+ | serverIPMap.put("beowulf5", "t3://192.168.0.165:7001"); | ||
+ | // Beowulf6 on Cat6 1Gb/Sec | ||
+ | serverNames.add("beowulf6"); | ||
+ | serverIPMap.put("beowulf6", "t3://192.168.0.166:7001"); | ||
+ | } | ||
+ | |||
+ | public JNDIClient() { | ||
+ | } | ||
+ | |||
+ | public void connect() { | ||
+ | /** | ||
+ | * Note: only import weblogic.jar and naming.jar | ||
+ | */ | ||
+ | // For JNDI we are forced to use Hashtable instead of HashMap | ||
+ | // populate the hashtables | ||
+ | for(String aServer : serverNames) { | ||
+ | Hashtable<String, String> aTable = new Hashtable<String, String>(); | ||
+ | contextMap.put(aServer,aTable); | ||
+ | aTable.put(Context.INITIAL_CONTEXT_FACTORY,CONTEXT_FACTORY_NAME); | ||
+ | aTable.put(Context.PROVIDER_URL, serverIPMap.get(aServer)); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Setup and connect to RMI Objects | ||
+ | */ | ||
+ | try { | ||
+ | // Establish RMI connections to the session beans | ||
+ | for(String aServer : serverNames) { | ||
+ | Context aContext = new InitialContext(contextMap.get(aServer)); | ||
+ | rmiContextMap.put(aServer, aContext); | ||
+ | System.out.println("Context for " + aServer + " : " + aContext); | ||
+ | // For qualified name look for weblogic log "EJB Deployed EJB with JNDI name" | ||
+ | Object aRemoteReference = aContext.lookup(SESSION_BEAN_REMOTE_NAME); | ||
+ | System.out.println("Remote Object: " + aRemoteReference); | ||
+ | NodeRemote aNode = (NodeRemote) PortableRemoteObject.narrow(aRemoteReference, NodeRemote.class); | ||
+ | remoteObjects.put(aServer, aNode); | ||
+ | System.out.println("Narrowed Session Bean: " + aNode); | ||
+ | // initialize state list | ||
+ | stateToSet.put(aServer, new Integer(0)); | ||
+ | } | ||
+ | |||
+ | NodeRemote aNode; | ||
+ | StringBuffer aBuffer = new StringBuffer(); | ||
+ | // Endlessly generate RMI requests | ||
+ | for(;;) { | ||
+ | // Send messages to entire grid in parallel | ||
+ | for(String remoteServer : remoteObjects.keySet()) { | ||
+ | aNode = remoteObjects.get(remoteServer); | ||
+ | // increment server's pending state | ||
+ | stateToSet.put(remoteServer, stateToSet.get(remoteServer).intValue() + 1); | ||
+ | aNode.setState(stateToSet.get(remoteServer)); | ||
+ | aBuffer = new StringBuffer("State from: "); | ||
+ | aBuffer.append(remoteServer); | ||
+ | aBuffer.append(" = "); | ||
+ | aBuffer.append(aNode.getState()); | ||
+ | System.out.println(aBuffer.toString()); | ||
+ | } | ||
+ | } | ||
+ | } catch (Exception e) { | ||
+ | e.printStackTrace(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | public static void main(String[] args) { | ||
+ | JNDIClient client = new JNDIClient(); | ||
+ | client.connect(); | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
====Distributed Automata==== | ====Distributed Automata==== | ||
=====Requirements===== | =====Requirements===== | ||
Line 18: | Line 164: | ||
===Projects In Analysis === | ===Projects In Analysis === | ||
===Projects Not Started === | ===Projects Not Started === | ||
+ | |||
==References== | ==References== |
Revision as of 17:02, 20 September 2010
EclipseLink Special Projects Group
- DISCLAIMER: This page reflects investigation into how EclipseLink technology can used as part of - or benefit from integration with other projects. It does NOT imply any formal certification from EclipseLink on these technologies or make any assumptions on the direction of the API. This page is purely experimental speculation.
- This page details initiatives or projects that use or could benefit from using EclipseLink technology.
- The scope of projects here also involves any that are experimental in the areas of performance, scalability, platform and hardware aware algorithms.
Projects
Projects In Development
Distributed RMI
EE Distributed Session Bean
- Deploy this on each of your WebLogic servers
@Stateful(mappedName="ejb/Node") @Local public class Node implements NodeRemote, NodeLocal { private int transition; private int state; public void setState(int aState) { System.out.println("_Distributed: new state: " + aState); state = aState; } public int getState() { return state; } public int getAdjacent(int offsetX, int offsetY) { return 1; } } @Remote public interface NodeRemote { //####<15-Sep-2010 1:21:15 o'clock PM EDT> <Info> <EJB> <xps435> <AdminServer> <[STANDBY] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1284571275760> <BEA-010009> //<EJB Deployed EJB with JNDI name org_eclipse_persistence_example_distributed_ClientEARorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home.> public void setState(int state); public int getState(); public int getAdjacent(int offsetX, int offsetY); }
SE client
- Run this on one of the servers or a separate SE JVM
package org.eclipse.persistence.jmx; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; import java.util.List; import java.util.Map; import javax.naming.Context; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; import org.eclipse.persistence.example.distributed.NodeRemote; /** * This class tests RMI connections to multiple WebLogic servers running on * remote JVM's. It is intended for experimental concurrency investigations only. * @author mfobrien 20100916 * */ public class JNDIClient { public static final List<String> serverNames = new ArrayList<String>(); private Map<String, Hashtable<String, String>> contextMap = new HashMap<String, Hashtable<String, String>>(); private Map<String, Context> rmiContextMap = new HashMap<String, Context>(); private Map<String, NodeRemote> remoteObjects = new HashMap<String, NodeRemote>(); private Map<String, Integer> stateToSet = new HashMap<String, Integer>(); private static Map<String, String> serverIPMap = new HashMap<String, String>(); private static final String CONTEXT_FACTORY_NAME = "weblogic.jndi.WLInitialContextFactory"; private static final String SESSION_BEAN_REMOTE_NAME = "ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote"; //private String sessionBeanRemoteName = "java:comp/env/ejb/Node"; // EE only //private String sessionBeanRemoteName = "org_eclipse_persistence_example_distributed_ClientEARorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home" ; /** * For each server add the name key and corresponding RMI URL */ static { // Beowulf5 on Cat6 1Gb/Sec serverNames.add("beowulf5"); serverIPMap.put("beowulf5", "t3://192.168.0.165:7001"); // Beowulf6 on Cat6 1Gb/Sec serverNames.add("beowulf6"); serverIPMap.put("beowulf6", "t3://192.168.0.166:7001"); } public JNDIClient() { } public void connect() { /** * Note: only import weblogic.jar and naming.jar */ // For JNDI we are forced to use Hashtable instead of HashMap // populate the hashtables for(String aServer : serverNames) { Hashtable<String, String> aTable = new Hashtable<String, String>(); contextMap.put(aServer,aTable); aTable.put(Context.INITIAL_CONTEXT_FACTORY,CONTEXT_FACTORY_NAME); aTable.put(Context.PROVIDER_URL, serverIPMap.get(aServer)); } /** * Setup and connect to RMI Objects */ try { // Establish RMI connections to the session beans for(String aServer : serverNames) { Context aContext = new InitialContext(contextMap.get(aServer)); rmiContextMap.put(aServer, aContext); System.out.println("Context for " + aServer + " : " + aContext); // For qualified name look for weblogic log "EJB Deployed EJB with JNDI name" Object aRemoteReference = aContext.lookup(SESSION_BEAN_REMOTE_NAME); System.out.println("Remote Object: " + aRemoteReference); NodeRemote aNode = (NodeRemote) PortableRemoteObject.narrow(aRemoteReference, NodeRemote.class); remoteObjects.put(aServer, aNode); System.out.println("Narrowed Session Bean: " + aNode); // initialize state list stateToSet.put(aServer, new Integer(0)); } NodeRemote aNode; StringBuffer aBuffer = new StringBuffer(); // Endlessly generate RMI requests for(;;) { // Send messages to entire grid in parallel for(String remoteServer : remoteObjects.keySet()) { aNode = remoteObjects.get(remoteServer); // increment server's pending state stateToSet.put(remoteServer, stateToSet.get(remoteServer).intValue() + 1); aNode.setState(stateToSet.get(remoteServer)); aBuffer = new StringBuffer("State from: "); aBuffer.append(remoteServer); aBuffer.append(" = "); aBuffer.append(aNode.getState()); System.out.println(aBuffer.toString()); } } } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { JNDIClient client = new JNDIClient(); client.connect(); } }
Distributed Automata
Requirements
- This simple application will serve as a test platform to experiment with a distributed SE or EE application so we can test various communication schemes between the physically distributed processing cores.
- A very simple data model consisting of a planar grid of SIMD ALU units will be partitioned among a group of Java Virtual Machines (both local and remote).
- We will not use a 2nd level cache as of yet like Coherence or Terracotta to handle inter-VM synchronization until we understand the problem space