Search in sources :

Example 1 with IControllableServerBehavior

use of org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior in project jbosstools-openshift by jbosstools.

the class ServiceManagerEnvironmentLoader method clearServiceManagerEnvironment.

public void clearServiceManagerEnvironment(IServer server) {
    IControllableServerBehavior behavior = JBossServerBehaviorUtils.getControllableBehavior(server);
    behavior.putSharedData(SHARED_INFO_KEY, null);
}
Also used : IControllableServerBehavior(org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior)

Example 2 with IControllableServerBehavior

use of org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior in project jbosstools-openshift by jbosstools.

the class CDKLaunchController method handleOpenShiftUnavailable.

private void handleOpenShiftUnavailable(final IControllableServerBehavior beh, final OpenShiftNotReadyPollingException osnrpe) {
    // Log error?  Show dialog?
    ((ControllableServerBehavior) beh).setServerStarted();
    ((Server) beh.getServer()).setMode(ILaunchManager.RUN_MODE);
    new Job(osnrpe.getMessage()) {

        @Override
        protected IStatus run(IProgressMonitor monitor) {
            return CDKCoreActivator.statusFactory().errorStatus("Error contacting OpenShift", osnrpe);
        }
    }.schedule();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) CDKServer(org.jboss.tools.openshift.cdk.server.core.internal.adapter.CDKServer) Server(org.eclipse.wst.server.core.internal.Server) IServer(org.eclipse.wst.server.core.IServer) ControllableServerBehavior(org.jboss.ide.eclipse.as.wtp.core.server.behavior.ControllableServerBehavior) IControllableServerBehavior(org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior) Job(org.eclipse.core.runtime.jobs.Job)

Example 3 with IControllableServerBehavior

use of org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior in project jbosstools-openshift by jbosstools.

the class AbstractCDKLaunchController method handleOpenShiftUnavailable.

private void handleOpenShiftUnavailable(final IControllableServerBehavior beh, final OpenShiftNotReadyPollingException osnrpe) {
    // Log error?  Show dialog?
    ((ControllableServerBehavior) beh).setServerStarted();
    ((Server) beh.getServer()).setMode("run");
    new Job(osnrpe.getMessage()) {

        @Override
        protected IStatus run(IProgressMonitor monitor) {
            return CDKCoreActivator.statusFactory().errorStatus("Error contacting OpenShift", osnrpe);
        }
    }.schedule();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) Server(org.eclipse.wst.server.core.internal.Server) IServer(org.eclipse.wst.server.core.IServer) ControllableServerBehavior(org.jboss.ide.eclipse.as.wtp.core.server.behavior.ControllableServerBehavior) IControllableServerBehavior(org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior) Job(org.eclipse.core.runtime.jobs.Job)

Example 4 with IControllableServerBehavior

use of org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior in project jbosstools-openshift by jbosstools.

the class OpenShiftServerTestUtils method mockServerBehaviour.

public static IControllableServerBehavior mockServerBehaviour(IServer server) {
    IControllableServerBehavior behaviour = mock(IControllableServerBehavior.class);
    doReturn(server).when(behaviour).getServer();
    return behaviour;
}
Also used : IControllableServerBehavior(org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior)

Example 5 with IControllableServerBehavior

use of org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior in project jbosstools-openshift by jbosstools.

the class OpenShiftSubsystemTest method testSubsystemsEAP.

@Test
public void testSubsystemsEAP() throws Exception {
    IServer s1 = OpenShiftServerTestUtils.createOpenshift3Server("example", OpenshiftEapProfileDetector.PROFILE);
    IControllableServerBehavior beh = (IControllableServerBehavior) s1.loadAdapter(IControllableServerBehavior.class, new NullProgressMonitor());
    String[] systems = new String[] { IControllableServerBehavior.SYSTEM_LAUNCH, IControllableServerBehavior.SYSTEM_MODULES, IControllableServerBehavior.SYSTEM_PUBLISH, IControllableServerBehavior.SYSTEM_SHUTDOWN, IFilesystemController.SYSTEM_ID, IDeploymentOptionsController.SYSTEM_ID, IModuleDeployPathController.SYSTEM_ID };
    String[] expected = new String[] { "org.jboss.tools.openshift.core.server.behavior.OpenShiftLaunchController", "org.jboss.tools.openshift.core.server.behavior.eap.OpenShiftEapModulesController", "org.jboss.tools.openshift.core.server.behavior.eap.OpenShiftEapPublishController", "org.jboss.tools.openshift.core.server.behavior.OpenShiftShutdownController", "org.jboss.ide.eclipse.as.wtp.core.server.behavior.LocalFilesystemController", "org.jboss.tools.openshift.core.server.behavior.OpenShiftDeploymentOptionsController", "org.jboss.tools.openshift.core.server.behavior.eap.OpenShiftEapDeployPathController" };
    for (int i = 0; i < systems.length; i++) {
        ISubsystemController c = beh.getController(systems[i]);
        assertEquals(expected[i], c.getClass().getName());
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IServer(org.eclipse.wst.server.core.IServer) IControllableServerBehavior(org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior) ISubsystemController(org.jboss.ide.eclipse.as.wtp.core.server.behavior.ISubsystemController) Test(org.junit.Test)

Aggregations

IControllableServerBehavior (org.jboss.ide.eclipse.as.wtp.core.server.behavior.IControllableServerBehavior)7 IServer (org.eclipse.wst.server.core.IServer)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IStatus (org.eclipse.core.runtime.IStatus)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 Job (org.eclipse.core.runtime.jobs.Job)2 Server (org.eclipse.wst.server.core.internal.Server)2 ControllableServerBehavior (org.jboss.ide.eclipse.as.wtp.core.server.behavior.ControllableServerBehavior)2 ISubsystemController (org.jboss.ide.eclipse.as.wtp.core.server.behavior.ISubsystemController)2 CDKServer (org.jboss.tools.openshift.cdk.server.core.internal.adapter.CDKServer)1 Test (org.junit.Test)1