Search in sources :

Example 1 with RemoteException

use of java.rmi.RemoteException in project che by eclipse.

the class ProjectResolverTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    MavenServerContext.setLoggerAndListener(new MavenServerLogger() {

        @Override
        public void warning(Throwable t) throws RemoteException {
        }

        @Override
        public void info(Throwable t) throws RemoteException {
        }

        @Override
        public void error(Throwable t) throws RemoteException {
        }
    }, (file, relativePath) -> {
        System.out.println(file.getAbsolutePath());
    });
    MavenSettings mavenSettings = new MavenSettings();
    mavenSettings.setLoggingLevel(MavenTerminal.LEVEL_INFO);
    mavenSettings.setMavenHome(new File(System.getenv("M2_HOME")));
    mavenSettings.setGlobalSettings(new File(System.getProperty("user.home"), ".m2/settings.xml"));
    File localRepository = new File("target/localrepo");
    localRepository.mkdirs();
    mavenSettings.setLocalRepository(localRepository);
    mavenServer = new MavenServerImpl(mavenSettings);
    mavenServer.setComponents(null, true, (level, message, throwable) -> {
        System.out.println(message);
    }, new MavenServerProgressNotifier() {

        @Override
        public void setText(String text) throws RemoteException {
            System.out.println(text);
        }

        @Override
        public void setPercent(double percent) throws RemoteException {
        }

        @Override
        public void setPercentUndefined(boolean undefined) throws RemoteException {
        }

        @Override
        public boolean isCanceled() throws RemoteException {
            return false;
        }
    }, true);
}
Also used : RemoteException(java.rmi.RemoteException) File(java.io.File) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with RemoteException

use of java.rmi.RemoteException in project che by eclipse.

the class MavenServerTest method testCustomComponents.

@Test
public void testCustomComponents() throws Exception {
    MavenSettings mavenSettings = new MavenSettings();
    mavenSettings.setLoggingLevel(MavenTerminal.LEVEL_DEBUG);
    MavenServerImpl mavenServerImpl = new MavenServerImpl(mavenSettings);
    boolean[] isPrintCalled = new boolean[] { false };
    mavenServerImpl.setComponents(null, false, new MavenTerminal() {

        @Override
        public void print(int level, String message, Throwable throwable) throws RemoteException {
            isPrintCalled[0] = true;
        }
    }, null, false);
    mavenServerImpl.getEffectivePom(new File(MavenServerTest.class.getResource("/EffectivePom/pom.xml").getFile()), Collections.emptyList(), Collections.emptyList());
    Assert.assertTrue(isPrintCalled[0]);
}
Also used : RemoteException(java.rmi.RemoteException) File(java.io.File) Test(org.testng.annotations.Test)

Example 3 with RemoteException

use of java.rmi.RemoteException in project che by eclipse.

the class MavenServerWrapper method dispose.

public void dispose() {
    MavenServer wrapped = getWrapped();
    if (wrapped != null) {
        try {
            wrapped.dispose();
        } catch (RemoteException e) {
            LOG.debug(e.getMessage(), e);
            onError();
        }
    }
    uncustomize();
}
Also used : MavenServer(org.eclipse.che.maven.server.MavenServer) RemoteException(java.rmi.RemoteException)

Example 4 with RemoteException

use of java.rmi.RemoteException in project che by eclipse.

the class MavenServerWrapper method reset.

public void reset() {
    MavenServer wrapped = getWrapped();
    if (wrapped != null) {
        try {
            wrapped.reset();
        } catch (RemoteException e) {
            LOG.debug(e.getMessage(), e);
            onError();
        }
    }
    uncustomize();
}
Also used : MavenServer(org.eclipse.che.maven.server.MavenServer) RemoteException(java.rmi.RemoteException)

Example 5 with RemoteException

use of java.rmi.RemoteException in project che by eclipse.

the class MavenServerWrapper method customize.

public void customize(MavenWorkspaceCache cache, MavenTerminal mavenTerminal, MavenProgressNotifier notifier, boolean failOnUnresolvedDependency, boolean alwaysUpdateSnapshot) {
    if (customization != null) {
        uncustomize();
    }
    MavenTerminal mavenTerminalWrapper;
    try {
        mavenTerminalWrapper = new MavenTerminalWrapper(mavenTerminal);
        UnicastRemoteObject.exportObject(mavenTerminalWrapper, 0);
    } catch (RemoteException e) {
        throw new RuntimeException(e);
    }
    MavenServerProgressNotifier wrapper;
    try {
        wrapper = new MavenServerProgressNotifierWrapper(notifier);
        UnicastRemoteObject.exportObject(wrapper, 0);
    } catch (RemoteException e) {
        throw new RuntimeException(e);
    }
    customization = new MavenCustomization(cache, mavenTerminalWrapper, wrapper, failOnUnresolvedDependency, alwaysUpdateSnapshot);
    perform(this::customizeMaven);
}
Also used : MavenTerminal(org.eclipse.che.maven.server.MavenTerminal) MavenServerProgressNotifier(org.eclipse.che.maven.server.MavenServerProgressNotifier) RemoteException(java.rmi.RemoteException)

Aggregations

RemoteException (java.rmi.RemoteException)368 IOException (java.io.IOException)54 VmwareContext (com.cloud.hypervisor.vmware.util.VmwareContext)38 VmwareHypervisorHost (com.cloud.hypervisor.vmware.mo.VmwareHypervisorHost)34 SSOException (com.iplanet.sso.SSOException)32 AMException (com.iplanet.am.sdk.AMException)31 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)29 AMEntryExistsException (com.iplanet.am.sdk.AMEntryExistsException)29 AMEventManagerException (com.iplanet.am.sdk.AMEventManagerException)29 LocateRegistry (java.rmi.registry.LocateRegistry)29 Registry (java.rmi.registry.Registry)29 UnsupportedEncodingException (java.io.UnsupportedEncodingException)27 EJBException (javax.ejb.EJBException)25 VirtualMachineMO (com.cloud.hypervisor.vmware.mo.VirtualMachineMO)24 ManagedObjectReference (com.vmware.vim25.ManagedObjectReference)24 ArrayList (java.util.ArrayList)22 InvocationTargetException (java.lang.reflect.InvocationTargetException)21 ConnectException (java.net.ConnectException)20 DatastoreMO (com.cloud.hypervisor.vmware.mo.DatastoreMO)18 ExecutionException (com.cloud.utils.exception.ExecutionException)18