WebSphere Extended Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

HttpPartitionBean の詳細

ここでは、HttpPartitionBean の内容を詳しく紹介します。デフォルトの HttpPartitionBean には、HTTP 区画化に必要な最小限の機能が揃っています。 区画との相互作用にサーブレット API のみを使用するときは、このコードを変更する 必要はありません。次の簡単な PSSB をアプリケーションに提供するだけです。
public class HttpPartitionBean implements javax.ejb.SessionBean {
	private javax.ejb.SessionContext mySessionCtx;
	private PartitionManager partitionManager;
	private HttpPartitionManager httpPartitionManager;

/**
* getSessionContext
*/
public javax.ejb.SessionContext getSessionContext() {
	return mySessionCtx;
}
/**
* setSessionContext
*/
public void setSessionContext(javax.ejb.SessionContext ctx) {
	mySessionCtx = ctx;
	try
	{
		InitialContext ic = new InitialContext();
		partitionManager = (PartitionManager)ic.lookup(PartitionManager.
    JNDI_NAME);
		httpPartitionManager = HttpPartitionManager.instance;
		partitionManager.setHttpPartitionManager(httpPartitionManager);
		String appName = partitionManager.getApplicationName();
		httpPartitionManager.setPartitionManager(appName,
     partitionManager);
	}
	catch(Exception e)
	{
		throw new EJBException(e);
	}
}
/**
 * ejbCreate
*/
	public void ejbCreate() throws javax.ejb.CreateException {
}
		/**
		* ejbActivate
		*/
	public void ejbActivate() {
 }
/**
* ejbPassivate
*/
	public void ejbPassivate() {
}
/**
* ejbRemove
*/
	public void ejbRemove() {
}

/**
 * @return
 */
public PartitionDefinition[] getPartitions() {	
	return new PartitionDefinition[0];
}

/**
 * This is called when a specific partition is assigned to this
  server process.
 * @param partitionName
 * @return
 */	
public boolean partitionLoadEvent(String partitionName)
 {
		return false;
   }
   
  /**
   * This is called when previously assigned partition is withdrawn
   from this server.
   * @param partitionName
    */	
  public void partitionUnloadEvent(String partitionName)
   {
  }
   
  /**
   * This may be called periodically to verify that this server
   is functioning correctly if
   * it was assigned a partition.
    * @param partitionName
    * @return
   */	
   public boolean isPartitionAlive(String partitionName)
   {
		return false;
    }
	}
254 行目の getPartitions() メソッドは、空の区画定義配列を 返すだけです。この EJB では、どの区画も指定していないからです。この EJB で区画を返す場合は、HttpPartitionManager に対して setPartitions() メソッドを 呼び出す必要があります。また、この EJB で setExpressions() メソッドを呼び出すことにより、HTTP 要求表現を 指定することもできます。
NoteColonSymbol ただし、セッション Bean の HttpPartitionBean.getPartitions() で 区画を設定したときは、以後は HttpPartitionManager.addPartition() メソッドで区画を 追加する必要があります。



Related concepts
EJB API: HttpPartitionBean の拡張

Reference topic    

Terms of Use | Feedback Last updated: Mar 20, 2006 12:35:11 PM EST
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=?topic=/com.ibm.websphere.xd.doc/info/WPF51/rwpfHttpPartBeandetails.html

© Copyright IBM 2005, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)