Java Code Examples for java.rmi.RemoteException

The following are top voted examples for showing how to use java.rmi.RemoteException. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openNaEF   File: FilteringFieldsMaker.java   View source code 6 votes vote down vote up
public List<FilterQueryContext> makeFilteringFieldsView() throws RemoteException, IOException, ExternalServiceException {
    List<FilterQueryContext> result = new ArrayList<FilterQueryContext>();

    List<String> fields = getConfig().getFilteringFields();
    Properties conditions = getConfig().getConditionOfFiltering();
    Properties displayNames = getConfig().getDisplayNames();

    for (String field : fields) {
        FilterQueryContext context = new FilterQueryContext();
        context.setMatcherClass(getMatcherClass(conditions.getProperty(field)));
        context.setDisplayName(displayNames.getProperty(field));
        context.setName(field);

        context.setEditorName(getEditorName(conditions.getProperty(field)));
        if (context.getEditorName() != null) {
            setProposals(field, context);
        }

        result.add(context);
    }

    return result;
}
 
Example 2
Project: jdk8u-jdk   File: RemoteVmManager.java   View source code 6 votes vote down vote up
/**
 * Return the current set of monitorable Java Virtual Machines.
 * <p>
 * The set returned by this method depends on the user name passed
 * to the constructor. If no user name was specified, then this
 * method will return all candidate JVMs on the system. Otherwise,
 * only the JVMs for the given user will be returned. This assumes
 * that the RMI server process has the appropriate permissions to
 * access the target set of JVMs.
 *
 * @return Set - the Set of monitorable Java Virtual Machines
 */
public Set<Integer> activeVms() throws MonitorException {
    int[] active = null;

    try {
        active = remoteHost.activeVms();

    } catch (RemoteException e) {
        throw new MonitorException("Error communicating with remote host: "
                                   + e.getMessage(), e);
    }

    Set<Integer> activeSet = new HashSet<Integer>(active.length);

    for (int i = 0; i < active.length; i++) {
        activeSet.add(new Integer(active[i]));
    }

    return activeSet;
}
 
Example 3
Project: OpenJSharp   File: Activation.java   View source code 6 votes vote down vote up
synchronized MarshalledObject<? extends Remote>
    activate(ActivationID id,
             boolean force,
             ActivationInstantiator inst)
    throws RemoteException, ActivationException
{
    MarshalledObject<? extends Remote> nstub = stub;
    if (removed) {
        throw new UnknownObjectException("object removed");
    } else if (!force && nstub != null) {
        return nstub;
    }

    nstub = inst.newInstance(id, desc);
    stub = nstub;
    /*
     * stub could be set to null by a group reset, so return
     * the newstub here to prevent returning null.
     */
    return nstub;
}
 
Example 4
Project: openNaEF   File: MplsnmsTefService.java   View source code 6 votes vote down vote up
@Override protected void serviceStarted() {
    super.serviceStarted();

    String rmiServiceName = System.getProperty(PROPERTYNAME_RMISERVICENAME);
    if (rmiServiceName == null) {
        throw new IllegalStateException("system property '" + PROPERTYNAME_RMISERVICENAME+ "' を設定してください.");
    }
    try {
        TefService.instance().getRmiRegistry().bind(rmiServiceName, new MplsnmsRmiServiceAccessPoint.Impl());
    } catch (RemoteException re) {
        throw new RuntimeException(re);
    } catch (AlreadyBoundException abe) {
        throw new RuntimeException(abe);
    }

    NaefTefService.instance().getRmcServerService()
        .registerMethod(AllocateVlanIpsubnetaddr.Call.class, new AllocateVlanIpsubnetaddr.Exec());
}
 
Example 5
Project: MaximoForgeViewerPlugin   File: FldBase64URN.java   View source code 6 votes vote down vote up
/**
 * Construct and attach to the specified mbo value
 * @throws RemoteException 
 */
public FldBase64URN(
    MboValue mbv 
   )
    throws MXException, RemoteException
{
		super( mbv );

	String query =  "(" + Constants.FIELD_SITEID + " = :" + Model.FIELD_SITEID + " OR " + Model.FIELD_SITEID + " IS NULL )"
	+ " AND (" + Constants.FIELD_ORGID + " = :" + Model.FIELD_ORGID + " OR " + Model.FIELD_ORGID + " IS NULL )";
		
       String thisAttr = getMboValue().getAttributeName() ;
       setRelationship(  Viewable.TABLE_NAME, query );

		setLookupKeyMapInOrder(
  				new String[] { thisAttr, BuildingModel.FIELD_URL, BuildingModel.FIELD_PARAMNAME, BuildingModel.FIELD_DESCRIPTION,
  						       BuildingModel.FIELD_LONGDESCRIPTION }
			,
			new String[] {  Viewable.FIELD_OBJECTKEY, Viewable.FIELD_BASE64URN, Viewable.FIELD_OBJECTKEY, Viewable.FIELD_DESCRIPTION,
  						        Viewable.FIELD_LONGDESCRIPTION }
			); 

		setListCriteria( query );
}
 
Example 6
Project: jdk8u-jdk   File: FilterUSRTest.java   View source code 6 votes vote down vote up
@Test(dataProvider = "bindData")
public void UnicastServerRef(String name, Object obj, int expectedFilterCount) throws RemoteException {
    try {
        RemoteImpl impl = RemoteImpl.create();
        UnicastServerRef ref = new UnicastServerRef(new LiveRef(0), impl.checker);

        Echo client = (Echo) ref.exportObject(impl, null, false);

        int count = client.filterCount(obj);
        System.out.printf("count: %d, obj: %s%n", count, obj);
        Assert.assertEquals(count, expectedFilterCount, "wrong number of filter calls");
    } catch (RemoteException rex) {
        if (expectedFilterCount == -1 &&
                UnmarshalException.class.equals(rex.getCause().getClass()) &&
                InvalidClassException.class.equals(rex.getCause().getCause().getClass())) {
            return; // normal expected exception
        }
        rex.printStackTrace();
        Assert.fail("unexpected remote exception", rex);
    } catch (Exception ex) {
        Assert.fail("unexpected exception", ex);
    }
}
 
Example 7
Project: openNaEF   File: LocationViewPage.java   View source code 6 votes vote down vote up
private void populateNode() throws ExternalServiceException, IOException, RemoteException {
    ListView<NodeDto> list = new ListView<NodeDto>("nodeList", this.model) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<NodeDto> item) {
            NodeDto node = item.getModelObject();
            BookmarkablePageLink<Void> link = NodePageUtil.createNodeLink("nodeLink", node);
            item.add(link);
        }
    };
    add(list);
    WebMarkupContainer container = new WebMarkupContainer("nodeBlock");
    add(container);
    container.setVisible(this.model.isVisible());
}
 
Example 8
Project: witsml-client   File: TrajectoryRequestTracker.java   View source code 6 votes vote down vote up
private String executeQuery() throws RemoteException {
    lastQueryTime = LocalDateTime.now().atZone(ZoneId.systemDefault());
    String query = "";
    setOptionsIn("");
    try {
        if (getVersion().toString().equals("1.3.1.1")) {
            query = getQuery("/1311/GetTrajectoryData.xml");
        } else if (getVersion().toString().equals("1.4.1.1")) {
            query = getQuery("/1411/GetTrajectoryData.xml");
            setOptionsIn("dataVersion=1.4.1.1");
        }
    } catch (Exception ex) {
        System.out.println("Error in getQuery ex : " + ex);
    }
    query = query.replace("%uidWell%", wellId);
    query = query.replace("%uidWellbore%", wellboreId);
    query = query.replace("%uidTrajectory%", trajectoryId);
    query = query.replace("%mdMn%", getQueryStartMd());
    setQuery(query);
    setCapabilitesIn("");
    return witsmlClient.executeTrajectoryQuery(getQuery(), getOptionsIn(), getCapabilitiesIn());
}
 
Example 9
Project: asw   File: ServiceFactory.java   View source code 6 votes vote down vote up
public SessionCounter getSessionCounter(String registryHost) {
	SessionCounter sessionCounter = null;
	/* ottiene la factory del session counter */
	SessionCounterFactory sessionCounterFactory = getSessionCounterFactory(registryHost);
	/* ora ottiene un riferimento al servizio remoto */
    try {
        logger.info("ServiceFactory: Getting a session counter from the factory");
        sessionCounter = sessionCounterFactory.getSessionCounter();
        int counterId = sessionCounter.getId();
        logger.info(
        		"ServiceFactory: Obtained a new session counter from the factory: "
        		+ "SessionCounter[" + counterId + "]"
        	);
    } catch (RemoteException e) {
    	logger.info("ServiceFactory: RemoteException: " + e.getMessage());
    }
    return sessionCounter;
}
 
Example 10
Project: MaximoForgeViewerPlugin   File: FldURL.java   View source code 5 votes vote down vote up
/**
 * Sets the orgid in the table that is referenced for the site selected.
 */
@Override
   public void action() 
	throws MXException, 
	       RemoteException
{
	super.action();
	
	String URL = getMboValue().getString();
	Mbo mbo    = getMboValue().getMbo();
       String bucketKey = DataRESTAPI.bucketFromBase64URN( URL );
	mbo.setValue( Bucket.FIELD_BUCKETKEYFULL, bucketKey, NOACCESSCHECK );
}
 
Example 11
Project: openjdk-jdk10   File: DynamicMethodMarshallerImpl.java   View source code 5 votes vote down vote up
public Object copyResult( Object result, ORB orb ) throws RemoteException
{
    if (needsResultCopy)
        return Util.copyObject( result, orb ) ;
    else
        return result ;
}
 
Example 12
Project: OpenJSharp   File: Util.java   View source code 5 votes vote down vote up
/**
 * Maps a SystemException to a RemoteException.
 * @param ex the SystemException to map.
 * @return the mapped exception.
 */
public static RemoteException mapSystemException(SystemException ex) {

    if (utilDelegate != null) {
        return utilDelegate.mapSystemException(ex);
    }
    return null;
}
 
Example 13
Project: openjdk-jdk10   File: RegistryFilterTest.java   View source code 5 votes vote down vote up
@Test
public void simpleDepthBuiltinNonRejectable() throws RemoteException, AlreadyBoundException, NotBoundException {
    int depthOverride = Integer.getInteger("test.maxdepth", REGISTRY_MAX_DEPTH);
    depthOverride = Math.min(depthOverride, REGISTRY_MAX_DEPTH);
    System.out.printf("overrideDepth: %d, filter: %s%n", depthOverride, registryFilter);
    try {
        String name = "reject2";
        DepthRejectableClass r1 = DepthRejectableClass.create(depthOverride);
        registry.bind(name, r1);
        registry.unbind(name);
    } catch (Exception rex) {
        Assert.fail("Registry filter should not have rejected depth: "
                        + depthOverride);
    }
}
 
Example 14
Project: MaximoForgeViewerPlugin   File: ExtCOBie24Factory.java   View source code 5 votes vote down vote up
@Override
public ModelValidator makeModelValidator(
    BIMProjectRemote projectMbo,
    ModelLoaderOptions options,
    ProgressLogger<ItemFACILITY> logger ) throws RemoteException, MXException
{
	System.out.println( "Ext Factry: makeModelValidator" );
 return super.makeModelValidator( projectMbo, options, logger );
}
 
Example 15
Project: OpenJSharp   File: Activation.java   View source code 5 votes vote down vote up
public void rebind(String name, Remote obj)
    throws RemoteException, AccessException
{
    if (name.equals(NAME)) {
        throw new AccessException(
            "binding ActivationSystem is disallowed");
    } else {
        super.rebind(name, obj);
    }
}
 
Example 16
Project: MaximoForgeViewerPlugin   File: ViewableManageBean.java   View source code 5 votes vote down vote up
public int detatchViewable() 
	throws MXException, 
	       RemoteException
{
	instantdelete();
	save();
	return EVENT_HANDLED;
}
 
Example 17
Project: Progetto-M   File: RMIDatabaseServer.java   View source code 5 votes vote down vote up
public static void main(String[] args) {
   /*
    MarioNOTE:
    creating a connection to the database
    */
   DatabaseConnection connection = new DatabaseConnection("java", "password");
   
   try{
       int port = 1099;
       /*
       MarioNOTE:
       creating a Registry that allows the server to
       publish a service and client to retrieve the proxy
       */
       Registry registry = LocateRegistry.createRegistry(port);
       DatabaseGestion DBGestor = new DatabaseGestion();
       registry.rebind("MyDatabase", DBGestor);
       
       System.out.println("\nServer is ready...");
       
   }catch(RemoteException ex){
       System.out.println("\nRMIDatabaseServer ERROR: " + ex);
   }
}
 
Example 18
Project: Progetto-M   File: ManagerGoal.java   View source code 5 votes vote down vote up
@Override
public void deleteGoal(int idPartita, int minuto, int numeroGiocatore, String nomeSquadra, String cittaSquadra, String nomeTorneo, int annoTorneo) throws RemoteException {
    try{
        query= "DELETE FROM GOAL\n "
                + "WHERE IDPARTITA = '" + idPartita + "' AND MINUTO = '" + minuto + "' AND MINUTO = '" + minuto + "' AND NUMEROGIOCATORE = '" + numeroGiocatore + "' AND NOMESQUADRA = '" + nomeSquadra.toUpperCase() + "' AND CITTASQUADRA = '" + cittaSquadra.toUpperCase() + "' AND NOMETORNEO = '" + nomeTorneo.toUpperCase() + "' AND ANNOTORENO = '" + annoTorneo + "' ;";
        PreparedStatement posted = DatabaseConnection.connection.prepareStatement(query);
        posted.executeUpdate(query);
    }catch(SQLException ex){
        System.out.println("ERROR:" + ex);
    } 
}
 
Example 19
Project: Progetto-M   File: ManagerGiocatore.java   View source code 5 votes vote down vote up
@Override
public void updateNomeGiocatore(int numero, String nomeSquadra, String cittaSquadra, String nuovoNome) throws RemoteException {
    try{
        query= "UPDATE GIOCATORE\n "
                + "SET NOMEGIOCATORE = '" + nuovoNome.toUpperCase() + "'\n "
                + "WHERE NUMERO = '" + numero + "' AND NOMESQUADRA = '" + nomeSquadra.toUpperCase() + "' AND CITTASQUADRA = '" + cittaSquadra.toUpperCase() + "' ;";
        PreparedStatement posted = DatabaseConnection.connection.prepareStatement(query);
        posted.executeUpdate(query);
    }catch(SQLException ex){
        System.out.println("ERROR:" + ex);
    }
}
 
Example 20
Project: openjdk-jdk10   File: AppleUserImpl.java   View source code 5 votes vote down vote up
/**
 * "Use" supplied apple object.  Create an AppleUserThread to
 * stress it out.
 */
public synchronized void useApple(Apple apple) throws RemoteException {
    String threadName = Thread.currentThread().getName();
    logger.log(Level.FINEST,
        threadName + ": AppleUserImpl.useApple(): BEGIN");

    AppleUserThread t =
        new AppleUserThread("AppleUserThread-" + (++threadNum), apple);
    t.start();

    logger.log(Level.FINEST,
        threadName + ": AppleUserImpl.useApple(): END");
}
 
Example 21
Project: OpenJSharp   File: Activation.java   View source code 5 votes vote down vote up
public ActivationDesc getActivationDesc(ActivationID id)
    throws ActivationException, UnknownObjectException, RemoteException
{
    checkShutdown();
    RegistryImpl.checkAccess("ActivationSystem.getActivationDesc");

    return getGroupEntry(id).getActivationDesc(id);
}
 
Example 22
Project: OpenJSharp   File: TCPTransport.java   View source code 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 23
Project: openjdk-jdk10   File: DynamicMethodMarshallerImpl.java   View source code 5 votes vote down vote up
public Object[] copyArguments( Object[] args,
    ORB orb ) throws RemoteException
{
    if (needsArgumentCopy)
        return Util.copyObjects( args, orb ) ;
    else
        return args ;
}
 
Example 24
Project: openNaEF   File: RemoteSnmpAccessClient.java   View source code 5 votes vote down vote up
@Override
public void setCommunityString(String community) {
    try {
        session.setCommunityString(community);
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 25
Project: common-services   File: ServiceMessagingTest.java   View source code 5 votes vote down vote up
@Test
public void testRemoteRequestSerialTiming() throws NotBoundException, RemoteException {
  int count = 100;
  TestService srv = client.getInstance();

  long start = System.currentTimeMillis();
  for (int i = 0; i < count; i++) {
    srv.getString("str" + i);
  }
  long end = System.currentTimeMillis();
  long time = end - start;
  System.out.println(String.format("Executed %d invocations in %d ms (%.2f ms/req)", count, time, ((double) time) / count));
}
 
Example 26
Project: parabuild-ci   File: ParabuildSoapBindingImpl.java   View source code 5 votes vote down vote up
public AgentConfiguration getAgentConfiguration(final int in0) throws RemoteException {
  final AgentConfig o = BuilderConfigurationManager.getInstance().getAgentConfig(in0);
  final AgentConfiguration config = new AgentConfiguration();
  config.setDescription(o.getDescription());
  config.setEnabled(o.isEnabled());
  config.setHost(o.getHost());
  config.setID(o.getID());
  config.setLocal(o.isLocal());
  config.setTimeStamp(o.getTimeStamp());
  return config;
}
 
Example 27
Project: monarch   File: DUnitBlackboard.java   View source code 5 votes vote down vote up
/**
 * put an object into a mailbox slot. The object must be java-serializable
 */
public void setMailbox(String boxName, Object value) {
  try {
    blackboard.setMailbox(boxName, value);
  } catch (RemoteException e) {
    throw new RuntimeException("remote call failed", e);
  }
}
 
Example 28
Project: OpenJSharp   File: PerfDataBuffer.java   View source code 5 votes vote down vote up
/**
 * Create a PerfDataBuffer instance for accessing the specified
 * instrumentation buffer.
 *
 * @param rvm the proxy to the remote MonitredVm object
 * @param lvmid the local Java Virtual Machine Identifier of the
 *              remote target.
 *
 * @throws MonitorException
 */
public PerfDataBuffer(RemoteVm rvm, int lvmid) throws MonitorException {

    this.rvm = rvm;
    try {
        ByteBuffer buffer = ByteBuffer.allocate(rvm.getCapacity());
        sample(buffer);
        createPerfDataBuffer(buffer, lvmid);

    } catch (RemoteException e) {
        throw new MonitorException("Could not read data for remote JVM "
                                   + lvmid, e);
    }
}
 
Example 29
Project: Progetto-M   File: ManagerLogin.java   View source code 5 votes vote down vote up
@Override
public void updateUsernameLogin(String username, String password, String nuovoUsername) throws RemoteException {
    try{
        query= "UPDATE LOGIN\n "
                + "SET USERNAME = '" + nuovoUsername + "'\n "
                + "WHERE USERNAME = '" + username + "' AND PASSWORD = '" + password + "' ;";
        PreparedStatement posted = DatabaseConnection.connection.prepareStatement(query);
        posted.executeUpdate(query);
    }catch(SQLException ex){
        System.out.println("ERROR:" + ex);
    } 
}
 
Example 30
Project: MaximoForgeViewerPlugin   File: BucketAccessSet.java   View source code 5 votes vote down vote up
/** 
    * Construct the set of Non-Persistent Custom Mbos.
    * @param ms The MboServerInterface NonPersistentCustomMboSet uses to access 
    * internals of the MXServer.
    */
public BucketAccessSet(
	MboServerInterface ms
) 
   	throws RemoteException
{
       super(ms);
   }
 
Example 31
Project: OpenJSharp   File: Activation.java   View source code 5 votes vote down vote up
/**
 * Returns the activation system stub if the specified name
 * matches the activation system's class name, otherwise
 * returns the result of invoking super.lookup with the specified
 * name.
 */
public Remote lookup(String name)
    throws RemoteException, NotBoundException
{
    if (name.equals(NAME)) {
        return systemStub;
    } else {
        return super.lookup(name);
    }
}
 
Example 32
Project: ats-framework   File: ISwtButton.java   View source code 4 votes vote down vote up
public void click(
String text,
String label,
String tooltip,
String inGroup,
int index ) throws RemoteException;
 
Example 33
Project: openNaEF   File: MplsnmsRmiServiceFacade.java   View source code 4 votes vote down vote up
public Impl() throws RemoteException {
}
 
Example 34
Project: parabuild-ci   File: ParabuildSoapBindingImpl.java   View source code 4 votes vote down vote up
/**
 * @noinspection ZeroLengthArrayAllocation
 */
public IssueAttribute[] getIssueAttributes(final int issueID) throws RemoteException {
  return new IssueAttribute[0];
}
 
Example 35
Project: pandemie   File: ServeurChatImpl.java   View source code 4 votes vote down vote up
@Override
public void Getmessage(String s,String User)throws RemoteException{
    this.program.addMessageChat("["+User+"] : "+s);
    notifyClient(s,User);
}
 
Example 36
Project: Voice_Activated_EV3_Robot   File: EV3Agent.java   View source code 4 votes vote down vote up
private AgentResponse returnTouchSensor() throws RemoteException {
	AgentResponse name = new AgentResponse("Firing in response to button");
	touchSensor();
	return name;
}
 
Example 37
Project: jdk8u-jdk   File: BooleanArrayCalls.java   View source code 4 votes vote down vote up
public Remote create() throws RemoteException {
    return new ServerImpl();
}
 
Example 38
Project: Progetto-M   File: ManagerPartita.java   View source code 4 votes vote down vote up
@Override
public void putPartita(int idPartita, String squadraCasa, String squadraOspite, Date data, String cfArbitro, String nomeTorneo, int annoTorneo) throws RemoteException {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
Example 39
Project: openNaEF   File: NaefDtoFacade.java   View source code 4 votes vote down vote up
public <T extends EntityDto> Set<T> selectIdPoolUsers(IdPoolDto<?, ?, T> pool, List<SearchCondition> conditions)
throws AuthenticationException, RemoteException;
 
Example 40
Project: jdk8u-jdk   File: RemoteObjArrayCalls.java   View source code 4 votes vote down vote up
public Remote[] call(Remote[] a) throws RemoteException {
    return a;
}