Search in sources :

Example 51 with RemoteException

use of java.rmi.RemoteException in project intellij-community by JetBrains.

the class Maven3ServerEmbedderImpl method resolveProject.

@NotNull
@Override
public Collection<MavenServerExecutionResult> resolveProject(@NotNull Collection<File> files, @NotNull Collection<String> activeProfiles, @NotNull Collection<String> inactiveProfiles) throws RemoteException, MavenServerProcessCanceledException {
    final DependencyTreeResolutionListener listener = new DependencyTreeResolutionListener(myConsoleWrapper);
    Collection<MavenExecutionResult> results = doResolveProject(files, new ArrayList<String>(activeProfiles), new ArrayList<String>(inactiveProfiles), Collections.<ResolutionListener>singletonList(listener));
    return ContainerUtil.mapNotNull(results, new Function<MavenExecutionResult, MavenServerExecutionResult>() {

        @Override
        public MavenServerExecutionResult fun(MavenExecutionResult result) {
            try {
                return createExecutionResult(result.getPomFile(), result, listener.getRootNode());
            } catch (RemoteException e) {
                ExceptionUtil.rethrowAllAsUnchecked(e);
            }
            return null;
        }
    });
}
Also used : MavenExecutionResult(org.jetbrains.idea.maven.server.embedder.MavenExecutionResult) DependencyTreeResolutionListener(org.apache.maven.shared.dependency.tree.DependencyTreeResolutionListener) RemoteException(java.rmi.RemoteException) NotNull(org.jetbrains.annotations.NotNull)

Example 52 with RemoteException

use of java.rmi.RemoteException in project intellij-community by JetBrains.

the class Maven3ServerEmbedderImpl method readModel.

@Override
@Nullable
public MavenModel readModel(File file) throws RemoteException {
    Map<String, Object> inputOptions = new HashMap<String, Object>();
    inputOptions.put(ModelProcessor.SOURCE, new FileModelSource(file));
    ModelReader reader = null;
    if (!StringUtil.endsWithIgnoreCase(file.getName(), "xml")) {
        try {
            Object polyglotManager = myContainer.lookup("org.sonatype.maven.polyglot.PolyglotModelManager");
            if (polyglotManager != null) {
                Method getReaderFor = ReflectionUtil.getMethod(polyglotManager.getClass(), "getReaderFor", Map.class);
                if (getReaderFor != null) {
                    reader = (ModelReader) getReaderFor.invoke(polyglotManager, inputOptions);
                }
            }
        } catch (ComponentLookupException ignore) {
        } catch (Throwable e) {
            Maven3ServerGlobals.getLogger().warn(e);
        }
    }
    if (reader == null) {
        try {
            reader = myContainer.lookup(ModelReader.class);
        } catch (ComponentLookupException ignore) {
        }
    }
    if (reader != null) {
        try {
            Model model = reader.read(file, inputOptions);
            return MavenModelConverter.convertModel(model, null);
        } catch (Exception e) {
            Maven3ServerGlobals.getLogger().warn(e);
        }
    }
    return null;
}
Also used : ModelReader(org.apache.maven.model.io.ModelReader) THashMap(gnu.trove.THashMap) FileModelSource(org.apache.maven.model.building.FileModelSource) Model(org.apache.maven.model.Model) UnicastRemoteObject(java.rmi.server.UnicastRemoteObject) ComponentLookupException(org.codehaus.plexus.component.repository.exception.ComponentLookupException) Method(java.lang.reflect.Method) ArtifactNotFoundException(org.apache.maven.artifact.resolver.ArtifactNotFoundException) InitializationException(org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException) ModelInterpolationException(org.apache.maven.project.interpolation.ModelInterpolationException) RemoteException(java.rmi.RemoteException) ComponentLookupException(org.codehaus.plexus.component.repository.exception.ComponentLookupException) ContextException(org.codehaus.plexus.context.ContextException) ArtifactResolutionException(org.apache.maven.artifact.resolver.ArtifactResolutionException) InvalidRepositoryException(org.apache.maven.artifact.InvalidRepositoryException) Nullable(org.jetbrains.annotations.Nullable)

Example 53 with RemoteException

use of java.rmi.RemoteException in project intellij-community by JetBrains.

the class Maven2ServerImpl method createIndexer.

public MavenServerIndexer createIndexer() throws RemoteException {
    try {
        Maven2ServerIndexerImpl result = new Maven2ServerIndexerImpl();
        UnicastRemoteObject.exportObject(result, 0);
        return result;
    } catch (RemoteException e) {
        throw rethrowException(e);
    }
}
Also used : RemoteException(java.rmi.RemoteException) Maven2ServerIndexerImpl(org.jetbrains.idea.maven.server.embedder.Maven2ServerIndexerImpl)

Example 54 with RemoteException

use of java.rmi.RemoteException in project intellij-community by JetBrains.

the class Maven2ServerImpl method createEmbedder.

public MavenServerEmbedder createEmbedder(MavenEmbedderSettings settings) throws RemoteException {
    try {
        Maven2ServerEmbedderImpl result = Maven2ServerEmbedderImpl.create(settings.getSettings());
        UnicastRemoteObject.exportObject(result, 0);
        return result;
    } catch (RemoteException e) {
        throw rethrowException(e);
    }
}
Also used : Maven2ServerEmbedderImpl(org.jetbrains.idea.maven.server.embedder.Maven2ServerEmbedderImpl) RemoteException(java.rmi.RemoteException)

Example 55 with RemoteException

use of java.rmi.RemoteException in project intellij-community by JetBrains.

the class MavenServerEmbedderTest method initEmbedder.

private void initEmbedder() throws RemoteException {
    if (myEmbedder != null)
        releaseEmbedder();
    myEmbedderImpl = Maven2ServerEmbedderImpl.create(MavenServerManager.convertSettings(getMavenGeneralSettings()));
    myEmbedder = new MavenEmbedderWrapper(null) {

        @NotNull
        @Override
        protected MavenServerEmbedder create() throws RemoteException {
            return myEmbedderImpl;
        }
    };
}
Also used : MavenEmbedderWrapper(org.jetbrains.idea.maven.server.MavenEmbedderWrapper) RemoteException(java.rmi.RemoteException) NotNull(org.jetbrains.annotations.NotNull) MavenServerEmbedder(org.jetbrains.idea.maven.server.MavenServerEmbedder)

Aggregations

RemoteException (java.rmi.RemoteException)396 IOException (java.io.IOException)57 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 EJBException (javax.ejb.EJBException)31 LocateRegistry (java.rmi.registry.LocateRegistry)30 Registry (java.rmi.registry.Registry)30 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)29 AMEntryExistsException (com.iplanet.am.sdk.AMEntryExistsException)29 AMEventManagerException (com.iplanet.am.sdk.AMEventManagerException)29 UnsupportedEncodingException (java.io.UnsupportedEncodingException)27 InvocationTargetException (java.lang.reflect.InvocationTargetException)27 ArrayList (java.util.ArrayList)25 VirtualMachineMO (com.cloud.hypervisor.vmware.mo.VirtualMachineMO)24 ManagedObjectReference (com.vmware.vim25.ManagedObjectReference)24 ConnectException (java.net.ConnectException)20 HashMap (java.util.HashMap)19 DatastoreMO (com.cloud.hypervisor.vmware.mo.DatastoreMO)18