Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.rmicallback.server;
- import com.rmicallback.client.ClientInterface;
- import java.rmi.RemoteException;
- import java.rmi.server.UnicastRemoteObject;
- import java.util.ArrayList;
- import java.util.List;
- public class ServerImpl extends UnicastRemoteObject implements ServerInterface{
- private List<ClientInterface> clients = new ArrayList();
- public ServerImpl() throws RemoteException{
- super();
- }
- @Override
- public int setClientInterface(ClientInterface cli) throws RemoteException{
- clients.add(cli);
- return clients.indexOf(cli);
- }
- @Override
- public void action(int value) throws RemoteException {
- System.out.println("ACTION!");
- clients.get(value).notifyMe();
- System.out.println("N VALUE IS : "+clients.get(value).getN());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement