WebSphere Extended Deployment, Version 6.0.x     운영 체제: AIX, HP-UX, Linux, Solaris, Windows, z/OS

getPartitions 메소드 갱신

setPartitionAlias

WebSphere Extended Deployment 버전 6.0에서는 partitionAlias 컨텍스트 기반 라우팅을 지원합니다. 다음 단계를 수행하여 getPartitions 메소드를 갱신한 후 다음을 추가할 수 있습니다.
 PartitionDefinition p = ivRuntime.createPartitionDefinition(pName)  
p.setPartitionAlias(pAlias) 

그러면 pName 또는 pAlias 컨텍스트를 사용하여 라우팅을 수행할 수 있습니다.

다음과 같이 getPartitions 메소드를 갱신하십시오.
	public PartitionDefinition[] getPartitions() 
	{
		ArrayList partitions = new ArrayList();
		
		// first add some key based partitions. These are static here but could
		// just as easily be loaded from a database when the application starts.
		String[] keys = new String[] {"IBM", "CSCO", "SUNW", "BEAS", "ORCL", 
"MSFT", "GE"};
		for(int i = 0; i < keys.length; ++i)
		{
			PartitionDefinition p = ivRuntime.createPartitionDefinition("K_" + 
keys[i], 
					"KEYS", PartitionScope.K_CLUSTER);
			partitions.add(p);
		}
		// now add some partitions for our hash test. We'll have a hash space
     of 16 slots
		// thus allowing us to scale to 16 JVMs. We can easily use a larger 
     number but 16
		// is sufficient for this sample.
		for(int i = 0; i < 16; ++i)
		{
			PartitionDefinition p = ivRuntime.createPartitionDefinition
     ("H_" + i, 
					"HASH", PartitionScope.K_CLUSTER);
			partitions.add(p);
		}
		PartitionDefinition p = ivRuntime.createPartitionDefinition
    ("SINGLETON");
		partitions.add(p);
		return (PartitionDefinition[])partitions.toArray();
	}

이 메소드는 파티션 설계의 세 가지 유형에 대한 예를 표시합니다.

첫 번째 설계에서는 키마다 파티션을 작성합니다. 여기에서 키는 재고 기호입니다. 재고 기호(일반적으로 수천 개임) 목록을 로드하고 각각에서 파티션 정의를 리턴할 수 있습니다. 다음 설계에서는 해싱 설계를 사용하여 고정 파티션 세트에 키 세트를 해시하도록 파티션을 작성하는 방법을 표시합니다. 샘플에서는 16개의 파티션을 사용합니다. 마지막 설계에서는 단일 파티션을 제공하여 클러스터에서 싱글톤 서비스를 작성하는 방법을 표시합니다.

PSSB(Partition Stateless Session Bean)는 시작 시 파티션 세트의 응용프로그램 스펙을 지원합니다. 지정된 각 파티션에서 클러스터 구성원은 파티션의 잠재적 활성화 구성원이 될 수 있습니다. 각 클러스터 구성원은 정상적으로 동일한 파티션 세트를 리턴하며 고객은 HA 관리자 및 해당 정책을 사용하여 파티션 배치를 판별할 수 있습니다. 이 설계에서는 파티션 배치 대 파티션 정의의 관계를 구분하여 유연성 및 단순성을 제공합니다. 각 클러스터 구성원에서 다른 파티션 세트를 리턴하는 복잡한 응용프로그램 논리를 구현하지 않아도 됩니다. 클러스터가 시작되면 클러스터 구성원 중 하나에서 각 파티션이 활성화됩니다.




Related tasks
샘플 파티션 추가

참조 주제:    

이용 약관 | 피드백 마지막 갱신 날짜: Mar 21, 2006 11:38:53 AM EST
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=?topic=/com.ibm.websphere.xd.doc/info/WPF51/rwpgetPartitions.html

© Copyright IBM 2005, 2006. All Rights Reserved.
이 Information Center는 Eclipse 테크놀러지로 강화되었습니다. (http://www.eclipse.org)