Search in sources :

Example 56 with RemoteException

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

the class MavenServerManager method create.

@SuppressWarnings("ConstantConditions")
@Override
@NotNull
protected synchronized MavenServer create() throws RemoteException {
    MavenServer result;
    try {
        result = mySupport.acquire(this, "");
    } catch (Exception e) {
        throw new RemoteException("Cannot start maven service", e);
    }
    myLoggerExported = UnicastRemoteObject.exportObject(myLogger, 0) != null;
    if (!myLoggerExported)
        throw new RemoteException("Cannot export logger object");
    myDownloadListenerExported = UnicastRemoteObject.exportObject(myDownloadListener, 0) != null;
    if (!myDownloadListenerExported)
        throw new RemoteException("Cannot export download listener object");
    result.set(myLogger, myDownloadListener);
    return result;
}
Also used : RemoteException(java.rmi.RemoteException) RemoteException(java.rmi.RemoteException) ExecutionException(com.intellij.execution.ExecutionException) NotNull(org.jetbrains.annotations.NotNull)

Example 57 with RemoteException

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

the class Maven30TransferListenerAdapter method transferProgressed.

@Override
public void transferProgressed(TransferEvent event) throws TransferCancelledException {
    checkCanceled();
    TransferResource r = event.getResource();
    long totalLength = r.getContentLength();
    String sizeInfo;
    if (totalLength <= 0) {
        sizeInfo = StringUtil.formatFileSize(event.getTransferredBytes()) + " / ?";
    } else {
        sizeInfo = StringUtil.formatFileSize(event.getTransferredBytes()) + " / " + StringUtil.formatFileSize(totalLength);
    }
    try {
        myIndicator.setText2(formatResourceName(event) + "  (" + sizeInfo + ')');
        if (totalLength <= 0) {
            myIndicator.setIndeterminate(true);
        } else {
            myIndicator.setIndeterminate(false);
            myIndicator.setFraction((double) event.getTransferredBytes() / totalLength);
        }
    } catch (RemoteException e) {
        throw new RuntimeRemoteException(e);
    }
}
Also used : TransferResource(org.sonatype.aether.transfer.TransferResource) RemoteException(java.rmi.RemoteException)

Example 58 with RemoteException

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

the class MavenServerManagerTest method testInitializingDoesntTakeReadAction.

public void testInitializingDoesntTakeReadAction() throws Exception {
    //make sure all components are initialized to prevent deadlocks
    MavenServerManager.getInstance().getOrCreateWrappee();
    ApplicationManager.getApplication().runWriteAction(() -> {
        Future result = ApplicationManager.getApplication().executeOnPooledThread(() -> {
            MavenServerManager.getInstance().shutdown(true);
            try {
                MavenServerManager.getInstance().getOrCreateWrappee();
            } catch (RemoteException e) {
                throw new RuntimeException(e);
            }
        });
        try {
            result.get(10, TimeUnit.SECONDS);
        } catch (InterruptedException | java.util.concurrent.ExecutionException e) {
            throw new RuntimeException(e);
        } catch (TimeoutException e) {
            printThreadDump();
            throw new RuntimeException(e);
        }
        result.cancel(true);
    });
}
Also used : Future(java.util.concurrent.Future) RemoteException(java.rmi.RemoteException) TimeoutException(java.util.concurrent.TimeoutException)

Example 59 with RemoteException

use of java.rmi.RemoteException in project opennms by OpenNMS.

the class OtrsTicketerPluginTest method createTicketAndArticle.

// This is just to bootstrap a saved ticket so that we can get it back later
private TicketIDAndNumber createTicketAndArticle(String ticketSubject, String articleBody) throws InterruptedException {
    TicketIDAndNumber idAndNumber = null;
    m_configDao = new DefaultOtrsConfigDao();
    TicketCore otrsTicket = new TicketCore();
    Credentials creds = new Credentials(m_configDao.getUserName(), m_configDao.getPassword());
    otrsTicket.setLock(m_configDao.getLock());
    otrsTicket.setQueue(m_configDao.getQueue());
    otrsTicket.setPriority(m_configDao.getPriority());
    otrsTicket.setState(m_configDao.getState());
    otrsTicket.setOwnerID(m_configDao.getOwnerID());
    otrsTicket.setUser(defaultUser);
    otrsTicket.setTitle(ticketSubject);
    Integer articleId = null;
    TicketServiceLocator service = new TicketServiceLocator();
    service.setTicketServicePortEndpointAddress(m_configDao.getEndpoint());
    TicketServicePort_PortType port = null;
    try {
        port = service.getTicketServicePort();
    } catch (ServiceException e1) {
        e1.printStackTrace();
    }
    try {
        idAndNumber = port.ticketCreate(otrsTicket, creds);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    ArticleCore otrsArticle = new ArticleCore();
    otrsArticle.setArticleType(m_configDao.getArticleType());
    otrsArticle.setSenderType(m_configDao.getArticleSenderType());
    otrsArticle.setContentType(m_configDao.getArticleContentType());
    otrsArticle.setHistoryType(m_configDao.getArticleHistoryType());
    otrsArticle.setHistoryComment(m_configDao.getArticleHistoryComment());
    otrsArticle.setSenderType(m_configDao.getArticleSenderType());
    otrsArticle.setSubject(defaultArticleSubject);
    otrsArticle.setFrom(m_configDao.getArticleFrom());
    otrsArticle.setBody(defaultArticleBody);
    otrsArticle.setUser(defaultUser);
    otrsArticle.setTicketID(idAndNumber.getTicketID());
    otrsArticle.setBody(articleBody);
    try {
        articleId = port.articleCreate(otrsArticle, creds);
        assertNotNull(articleId);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    return idAndNumber;
}
Also used : ArticleCore(org.opennms.integration.otrs.ticketservice.ArticleCore) ServiceException(javax.xml.rpc.ServiceException) DefaultOtrsConfigDao(org.opennms.netmgt.ticketer.otrs.common.DefaultOtrsConfigDao) TicketServicePort_PortType(org.opennms.integration.otrs.ticketservice.TicketServicePort_PortType) RemoteException(java.rmi.RemoteException) TicketCore(org.opennms.integration.otrs.ticketservice.TicketCore) TicketServiceLocator(org.opennms.integration.otrs.ticketservice.TicketServiceLocator) Credentials(org.opennms.integration.otrs.ticketservice.Credentials) TicketIDAndNumber(org.opennms.integration.otrs.ticketservice.TicketIDAndNumber)

Example 60 with RemoteException

use of java.rmi.RemoteException in project opennms by OpenNMS.

the class RemedyTicketerPlugin method save.

private void save(Ticket newTicket) throws PluginException {
    HPD_IncidentInterface_Create_WSPortTypePortType port = getCreateTicketServicePort(m_createportname, m_createendpoint);
    try {
        String incident_number = port.helpDesk_Submit_Service(getRemedyAuthenticationHeader(), getRemedyCreateInputMap(newTicket)).getIncident_Number();
        LOG.debug("created new remedy ticket with reported incident number: {}", incident_number);
        newTicket.setId(incident_number);
    } catch (RemoteException e) {
        e.printStackTrace();
        throw new PluginException("Problem saving ticket", e);
    }
}
Also used : HPD_IncidentInterface_Create_WSPortTypePortType(org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSPortTypePortType) RemoteException(java.rmi.RemoteException)

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