Search in sources :

Example 76 with RemoteException

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

the class Maven3ServerEmbedderImpl method resolveTransitively.

@NotNull
@Override
public List<MavenArtifact> resolveTransitively(@NotNull List<MavenArtifactInfo> artifacts, @NotNull List<MavenRemoteRepository> remoteRepositories) throws RemoteException, MavenServerProcessCanceledException {
    try {
        Set<Artifact> toResolve = new LinkedHashSet<Artifact>();
        for (MavenArtifactInfo each : artifacts) {
            toResolve.add(createArtifact(each));
        }
        Artifact project = getComponent(ArtifactFactory.class).createBuildArtifact("temp", "temp", "666", "pom");
        Set<Artifact> res = getComponent(ArtifactResolver.class).resolveTransitively(toResolve, project, Collections.EMPTY_MAP, myLocalRepository, convertRepositories(remoteRepositories), getComponent(ArtifactMetadataSource.class)).getArtifacts();
        return MavenModelConverter.convertArtifacts(res, new THashMap<Artifact, MavenArtifact>(), getLocalRepositoryFile());
    } catch (ArtifactResolutionException e) {
        Maven3ServerGlobals.getLogger().info(e);
    } catch (ArtifactNotFoundException e) {
        Maven3ServerGlobals.getLogger().info(e);
    } catch (Exception e) {
        throw rethrowException(e);
    }
    return Collections.emptyList();
}
Also used : ArtifactResolutionException(org.apache.maven.artifact.resolver.ArtifactResolutionException) ArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory) ArtifactNotFoundException(org.apache.maven.artifact.resolver.ArtifactNotFoundException) Artifact(org.apache.maven.artifact.Artifact) 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) NotNull(org.jetbrains.annotations.NotNull)

Example 77 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 78 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 79 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 80 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)

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