1. 가브리엘스 오보에
엔리오 모리코네 지휘
2. 경기병 서곡
3. 브람스 헝가리안 댄스 5번
4. 리베르 탱고
5. 윌리엄텔 서곡
1. 가브리엘스 오보에
엔리오 모리코네 지휘
2. 경기병 서곡
3. 브람스 헝가리안 댄스 5번
4. 리베르 탱고
5. 윌리엄텔 서곡
| <script type="text/javascript" src="prototype.js" ></script> |
| var theDivs = $('div1', 'div2', div3' ); |
| var obj = { partA : one, partB : two, partC : three }; var hashObj = $H(obj); var arr = hashObj.values(); |
| var range = $R(10, 20, false); range.each( function(value, index){ alert(value ); }); |
JMX를 통하여 이 리모트 객체의 구현체인 서비스를 기동/종료/재기동이 가능하고 기동여부를 확인하고 설정을 변경이 가능하게 될 것이다.
Sample Classes
sample Class는 아래의 5개 클래스로 구성되어 있다.
public void sayHello( String name );
이것은 Client의 요청을 실행하게 될 것이다.
public void start()
public void stop()
public boolean isRunning()
Server Class
public class Server
{
public static void main(String[] args) throws Exception
{
MBeanServer server = MBeanServerFactory.createMBeanServer();
ObjectName name = new ObjectName("examples:type=remote");
MyRemoteServiceObject remote = new MyRemoteServiceObject();
server.registerMBean(remote, name);
MyRemoteServiceObjectMBean managed = (MyRemoteServiceObjectMBean)MBeanServerInvocationHandler.newProxyInstance(server, name, MyRemoteServiceObjectMBean.class, false);
managed.start();
}
}
public class MyRemoteServiceObject extends RemoteServer implements MyRemoteService, MyRemoteServiceObjectMBean
{
private boolean m_running;
public MyRemoteServiceObject() throws RemoteException {}
public void sayHello(String name) throws RemoteException
{
System.out.println("Hello, " + name);
}
public void start() throws Exception
{
if (!m_running)
{
UnicastRemoteObject.exportObject(this);
InitialContext ctx = new InitialContext();
ctx.rebind(JNDI_NAME, this);
m_running = true;
System.out.println("My remote service started successfully");
}
}
public void stop() throws Exception
{
if (m_running)
{
InitialContext ctx = new InitialContext();
ctx.unbind(JNDI_NAME);
UnicastRemoteObject.unexportObject(this, false);
m_running = false;
System.out.println("My remote service stopped successfully");
}
}
public boolean isRunning()
{
return m_running;
}
}