stockhandlerrmiserverimpl.java.svn-base

来自「rmi server web service for a stock track」· SVN-BASE 代码 · 共 50 行

SVN-BASE
50
字号
package ase.assignment.sts.rmi.server;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import ase.assignment.sts.api.StockHandler;
import ase.assignment.sts.beans.StockAssertEntity;
import ase.assignment.sts.beans.StockQuoteEntity;
import ase.assignment.sts.db.impl.HandlerFactoryJDBCImpl;

public class StockHandlerRMIServerImpl extends UnicastRemoteObject implements
		StockHandler {

	protected StockHandlerRMIServerImpl() throws RemoteException {
		super();
		// TODO Auto-generated constructor stub
	}

	private static final long serialVersionUID = 3930456185990547554L;

	private StockHandler getHandler() throws RemoteException {
		return new HandlerFactoryJDBCImpl().getStockHandler();
	}

	public void create(StockAssertEntity stock) throws RemoteException {
		getHandler().create(stock);
	}

	public void delete(int stockId) throws RemoteException {
		getHandler().delete(stockId);
	}

	public StockAssertEntity findById(int stockId) throws RemoteException {
		return getHandler().findById(stockId);
	}

	public StockAssertEntity[] getAllStocks(int porId) throws RemoteException {
		return getHandler().getAllStocks(porId);
	}

	public StockQuoteEntity getCurrentPrice(int stockId) throws RemoteException {
		return getHandler().getCurrentPrice(stockId);
	}

	public void update(StockAssertEntity stock) throws RemoteException {
		getHandler().update(stock);
	}

}

⌨️ 快捷键说明

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