프로그래밍을 통한 애플리케이션 시작

관리 콘솔, wsadmin 도구 또는 프로그래밍을 통한 애플리케이션을 시작할 수 있습니다. 이 예를 사용하여 프로그래밍을 통한 애플리케이션을 시작하십시오.

시작하기 전에

이 태스크에서는 사용자가 MBean 프로그래밍의 기본 사항을 알고 있다고 가정합니다. MBean 프로그래밍에 대한 정보는 MBean Java™ API(Application Programming Interface) 문서를 참조하십시오.이 Information Center에서 참조 > 프로그래밍 인터페이스 > Mbean 인터페이스를 클릭하십시오.

WebSphere® Application Server에서 애플리케이션을 시작하려면 먼저 애플리케이션을 설치해야 합니다.

이 태스크 정보

다음 태스크를 수행하여 프로그래밍을 통한 애플리케이션을 시작하십시오.

프로시저

  1. WebSphere Application Server에 관리 클라이언트를 연결하십시오.
  2. 애플리케이션 관리 프록시를 작성하십시오.
  3. 애플리케이션 이름과 선택적으로 애플리케이션을 시작할 대상 목록을 전달하여 프록시에서 startApplication 메소드를 호출하십시오.

결과

코드를 실행하면 애플리케이션이 시작됩니다.

다음 예제에서는 이전에 나열한 단계에 따라 애플리케이션을 시작하는 방법을 보여줍니다. 일부 구문은 인쇄를 위해 여러 줄로 표시됩니다.

//Do a get of the administrative client to connect to
//WebSphere Application Server.

AdminClient client = ...;
String appName = "myApp";
Hashtable prefs = new Hashtable();
// Use the AppManagement MBean to start and stop applications on all or some targets.
// The AppManagement MBean is on the deployment manager in the WebSphere Application Server, Network Deployment product.

// Query and get the AppManagement MBean.
ObjectName on = new ObjectName ("WebSphere:type=AppManagement,*");
Iterator iter = client.queryNames (on, null).iterator();
ObjectName appmgmtON = (ObjectName)iter.next();
			
//Start the application on all targets.
AppManagement proxy = AppManagementProxy.getJMXProxyForClient(client);
String started = proxy.startApplication(appName, prefs, null);
System.out.println("Application started on folloing servers: " + started);
			
//Start the application on some targets.
//String targets = "WebSphere:cell=cellname,node=nodename,
server=servername+WebSphere:cell=cellname,cluster=clusterName";
//String started1 = proxy.startApplication(appName, targets, prefs, null);
//System.out.println("Application started on following servers: " + started1)

주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tjmx_start_app
파일 이름:tjmx_start_app.html