⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rmiserverstarter.java.svn-base

📁 rmi server web service for a stock track systerm
💻 SVN-BASE
字号:
package ase.assignment.sts.rmi.server;

import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.Naming;

import ase.assignment.sts.utils.STSConstants;

public class RMIServerStarter {

	public static void main(String args[]) {

		System.out.println(System.getProperty("java.security.policy"));

		try {

			// set the security manager
			// if (System.getSecurityManager() == null) {
			// System.setSecurityManager(new SecurityManager());
			// }
			// HandlerFactory factory = new HandlerFactoryRMIServerImpl();
			// CustomerHandler customer = factory.getCustomerHandler();
			// CustomerHandler customerStub =
			// (CustomerHandler) UnicastRemoteObject.exportObject(customer, 0);
			// Registry registry = LocateRegistry.getRegistry();
			// System.out.println("RMI Server before binding");
			// registry.rebind(STSConstants.RMI_NAME_CUSTOMER, customerStub);

		/*	System.setSecurityManager(new RMISecurityManager());
			Registry registry = LocateRegistry.getRegistry();
			registry.rebind(STSConstants.RMI_NAME_CUSTOMER,
					new CustomerHandlerRMIServerImpl());
			registry.rebind(STSConstants.RMI_NAME_PORTFOLIO,
					new PortfolioHandlerRMIServerImpl());
			registry.rebind(STSConstants.RMI_NAME_STOCK,
					new StockHandlerRMIServerImpl());
*/

			Naming.rebind(STSConstants.RMI_NAME_CUSTOMER,
					new CustomerHandlerRMIServerImpl());
			Naming.rebind(STSConstants.RMI_NAME_PORTFOLIO,
					new PortfolioHandlerRMIServerImpl());
			Naming.rebind(STSConstants.RMI_NAME_STOCK,
					new StockHandlerRMIServerImpl());
				
			System.out.println("RMI Server running.....");

		}

		catch (RemoteException re) {
			System.out.println("Remote exception: " + re.toString());
		}
		catch(Exception e){
			System.out.println("Remote Server launching error: " + e.toString());	
		}

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -