Search in sources :

Example 1 with NoServerPlatform

use of org.eclipse.persistence.platform.server.NoServerPlatform 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();
}
Also used : DatabaseSessionImpl(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl) RemoteCommandManager(org.eclipse.persistence.sessions.coordination.RemoteCommandManager) NoServerPlatform(org.eclipse.persistence.platform.server.NoServerPlatform) AbstractSession(org.eclipse.persistence.internal.sessions.AbstractSession)

Example 2 with NoServerPlatform

use of org.eclipse.persistence.platform.server.NoServerPlatform in project eclipselink by eclipse-ee4j.

the class SessionsFactory method buildServerPlatformConfig.

/**
 * INTERNAL: Build the appropriate server platform
 */
protected ServerPlatform buildServerPlatformConfig(ServerPlatformConfig platformConfig, DatabaseSessionImpl session) {
    if (platformConfig == null) {
        return new NoServerPlatform(session);
    }
    // Build the server platform, the config model knows which to build.
    ServerPlatform platform;
    if (platformConfig instanceof CustomServerPlatformConfig) {
        platform = buildCustomServerPlatformConfig((CustomServerPlatformConfig) platformConfig, session);
    } else {
        // A supported platform so instantiate an object of its type.
        String serverClassName = platformConfig.getServerClassName();
        if (platformConfig.isSupported()) {
            platform = ServerPlatformUtils.createServerPlatform(session, serverClassName, m_classLoader);
        } else {
            throw SessionLoaderException.serverPlatformNoLongerSupported(serverClassName);
        }
    }
    // Process the common elements in ServerPlatformConfig
    processServerPlatformConfig(platformConfig, platform);
    return platform;
}
Also used : CustomServerPlatformConfig(org.eclipse.persistence.internal.sessions.factories.model.platform.CustomServerPlatformConfig) NoServerPlatform(org.eclipse.persistence.platform.server.NoServerPlatform) ServerPlatform(org.eclipse.persistence.platform.server.ServerPlatform) NoServerPlatform(org.eclipse.persistence.platform.server.NoServerPlatform)

Aggregations

NoServerPlatform (org.eclipse.persistence.platform.server.NoServerPlatform)2 AbstractSession (org.eclipse.persistence.internal.sessions.AbstractSession)1 DatabaseSessionImpl (org.eclipse.persistence.internal.sessions.DatabaseSessionImpl)1 CustomServerPlatformConfig (org.eclipse.persistence.internal.sessions.factories.model.platform.CustomServerPlatformConfig)1 ServerPlatform (org.eclipse.persistence.platform.server.ServerPlatform)1 RemoteCommandManager (org.eclipse.persistence.sessions.coordination.RemoteCommandManager)1