Understanding How Applications Deploy Foundation Services

Applications can access service deployments from a SAS Metadata Repository or an XML file (that contains exported metadata). Applications deploy services as follows:
  • For a local service deployment, the application uses a service loader utility to instantiate and initialize the SAS Foundation Services for a local service deployment and to register the deployed services with a local Discovery Service. The application then has exclusive access to these locally deployed services. For a stand-alone deployment, you do not need to configure a Discovery Service.
  • For a remote service deployment that is shared between applications, one of the applications must deploy the remote service deployment. The application uses a service loader utility to instantiate and initialize the foundation services for a remote service deployment and to register the deployed services with a local Discovery Service. The application then has local access to the services. To enable the services for remote access, the remote service deployment specifies a remote Discovery Service that registers with the service registry. The remote service deployment also contains a distributable configuration for any service that remote clients access. These remote services are registered with a remote Discovery Service. Other applications can then use the remote Discovery Service to access the remote services.
Note: A foundation service-enabled application can be either a standard client application or a Web client application that runs in a servlet container.
Your application must install the appropriate JAR files (for example, sas.svc.core.jar) in a location that is accessible only to its own classloader. This installation restriction is due to the inheritance hierarchy of classloaders. This inheritance hierarchy enables multiple applications to access classes that are available to higher level class loaders. Therefore, each foundation service-enabled application should not install the required JAR files in a location that is accessible to a class loader that might be shared among multiple applications. For details about coding client applications for service deployment, see the SAS Foundation Services class documentation for com.sas.services.deployment and com.sas.services.discovery at http://support.sas.com/rnd/javadoc/93 and the SAS Integration Technologies: Java Client Developer's Guide.
The following figure shows these components and how they work together.
A Remote Service Configuration
A Remote Service Configuration
In the figure, Applications 1 through 4 all access their local and remote service deployment configurations from a SAS Metadata Repository.
If Application 1 deploys the remote service deployment, the services are registered with a local Discovery Service and a remote Discovery Service. Applications 2, 3, and 4 can then use the remote Discovery Service to locate and access the deployed remote services. All of the applications share the same remote service deployment. In addition, each application has exclusive access to its own local service deployment. For information about how applications locate and access services, see Understanding How Applications Locate Foundation Services .
The different components in the preceding figure might exist on the same Web server or on different Web servers. You can install your applications and deploy your services on separate machines as required by the needs of your implementation. For information about distributing service deployments, see Redistributing Service Deployments.