use of org.eclipse.persistence.sessions.coordination.RemoteCommandManager in project eclipselink by eclipse-ee4j.
the class SessionsFactory method buildRemoteCommandManagerConfig.
/**
* INTERNAL:
*/
protected void buildRemoteCommandManagerConfig(RemoteCommandManagerConfig rcmConfig, AbstractSession session) {
if (rcmConfig != null) {
RemoteCommandManager rcm = new RemoteCommandManager(session);
// Commands
processCommandsConfig(rcmConfig.getCommandsConfig(), rcm);
// Transport Manager - will set the built TransportManager on the given
// Remote command manager that is passed in
buildTransportManager(rcmConfig.getTransportManagerConfig(), rcm);
// Channel - XML Schema default is TopLinkCommandChannel
rcm.setChannel(rcmConfig.getChannel());
}
}
use of org.eclipse.persistence.sessions.coordination.RemoteCommandManager in project eclipselink by eclipse-ee4j.
the class RCMDistributedServer method run.
/**
* This method starts the server and makes the dispatcher available
* Creation date: (7/21/00 9:58:37 AM)
*/
@Override
public void run() {
RemoteCommandManager cm = new RemoteCommandManager((AbstractSession) session);
// set propagate command synchronously for testing
cm.setShouldPropagateAsynchronously(false);
cm.getDiscoveryManager().setAnnouncementDelay(0);
// ovewrite default to use RMI registry naming service
cm.getTransportManager().setNamingServiceType(TransportManager.REGISTRY_NAMING_SERVICE);
// set full rmi URL of local host
cm.setUrl("rmi://localhost:1099");
// turn on cache sync with RCM
((AbstractSession) session).setShouldPropagateChanges(true);
cm.setServerPlatform(new NoServerPlatform(new DatabaseSessionImpl()));
cm.initialize();
}
use of org.eclipse.persistence.sessions.coordination.RemoteCommandManager in project eclipselink by eclipse-ee4j.
the class JGroupsConfigurationTest method test.
@Override
protected void test() throws Throwable {
AbstractSession session = getAbstractSession();
RemoteCommandManager rcm = new RemoteCommandManager(session);
TransportManager transport = (TransportManager) Class.forName("org.eclipse.persistence.sessions.coordination.jgroups.JGroupsTransportManager").getConstructor().newInstance();
rcm.setTransportManager(transport);
transport.createLocalConnection();
RemoteConnection connection = transport.getConnectionToLocalHost();
try {
int multicastPort = getMulticastPort(connection);
Assert.assertEquals("Default multicast port different than expected", 45588, multicastPort);
} catch (Exception x) {
Assert.fail("Failed to retrieve multicast port: " + x.getMessage());
} finally {
connection.close();
}
rcm = new RemoteCommandManager(session);
transport = (TransportManager) Class.forName("org.eclipse.persistence.sessions.coordination.jgroups.JGroupsTransportManager").getConstructor().newInstance();
transport.setConfig("org/eclipse/persistence/testing/config/distributedservers/rcm/jgroups/jgroups-udp-config.xml");
rcm.setTransportManager(transport);
transport.createLocalConnection();
connection = transport.getConnectionToLocalHost();
try {
int multicastPort = getMulticastPort(connection);
Assert.assertEquals("Configured multicast port different than expected", 45678, multicastPort);
} catch (Exception x) {
Assert.fail("Failed to retrieve multicast port: " + x.getMessage());
} finally {
connection.close();
}
}
use of org.eclipse.persistence.sessions.coordination.RemoteCommandManager in project eclipselink by eclipse-ee4j.
the class JPARCMLocalChangeSetTestSuite method initializeRCMOnSession.
public void initializeRCMOnSession(ServerSession session) {
RemoteCommandManager rcm = new RemoteCommandManager(session);
rcm.setShouldPropagateAsynchronously(true);
session.setCommandManager(rcm);
session.setShouldPropagateChanges(true);
resetLocalConnection(session);
}
use of org.eclipse.persistence.sessions.coordination.RemoteCommandManager in project eclipselink by eclipse-ee4j.
the class DistributedCacheMergeTest method buildSession.
protected Server buildSession(String sessionName) throws Exception {
ServerSession session = null;
Project p = getNewProject();
DatabaseLogin theLogin = originalSession.getLogin();
p.setLogin(originalSession.getLogin());
session = (ServerSession) p.createServerSession();
session.setSessionLog(getSession().getSessionLog());
RemoteCommandManager cm = new RemoteCommandManager(session);
// set propagate command asynchronously for testing
cm.setShouldPropagateAsynchronously(true);
cm.getDiscoveryManager().setAnnouncementDelay(0);
// ovewrite default to use RMI registry naming service
cm.getTransportManager().setNamingServiceType(TransportManager.REGISTRY_NAMING_SERVICE);
// set full rmi URL of local host
cm.setUrl("rmi://localhost:41099");
// turn on cache sync with RCM
session.setShouldPropagateChanges(true);
cm.setServerPlatform(getSession().getServerPlatform());
cm.initialize();
// Sleep to allow RCM to startup and find each session.
try {
Thread.sleep(2000);
} catch (Exception ignore) {
}
return session;
}
Aggregations