org.glassfish.examples.ctm
Class ServiceProviderEngine

java.lang.Object
  extended by org.glassfish.examples.ctm.ServiceProviderEngine

@Service
@Singleton
public class ServiceProviderEngine
extends java.lang.Object

In the example, this code uses the Environment object, which sometimes will be from Tenant1, and other times from Tenant2. However, since this class is in the Singleton scope, the Environment object cannot be re-injected. Not to fear, because the Environment object is produced as part of a Proxiable scope so the injected entity is actually a proxy. Hence, when this service uses the Environment object when Tenant1 is in effect it will get the values for Tenant1, and when Tenant2 is in effect it will get the values for Tenant2.

Author:
jwells

Method Summary
 Environment getEnvironment()
           
 int getTenantMax()
           
 int getTenantMin()
           
 java.lang.String getTenantName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTenantName

public java.lang.String getTenantName()

getTenantMin

public int getTenantMin()

getTenantMax

public int getTenantMax()

getEnvironment

public Environment getEnvironment()


Copyright © 2012 Oracle Corporation. All Rights Reserved.