Skip navigation links
Oracle® Fusion Middleware Java API Reference for the Lifecycle Management Environment Specification
12c (12.2.1.3)

E95511-02

envspec 2.0.0-SNAPSHOT API

Fusion Middleware Environment Specification

See: Description

Packages 
Package Description
oracle.fmwplatform.envspec.environment
This package contains classes that are used to represent various types of actual (existing) environments.
oracle.fmwplatform.envspec.environment.topology
This package contains classes that are used to describe components of a Topology.
oracle.fmwplatform.envspec.exception
This package contains exceptions that may be produced by the FMW Environment Specification classes.
oracle.fmwplatform.envspec.helper  
oracle.fmwplatform.envspec.model
This package contains classes that are used to represent models of real (existing) or imagined (to be created) environments.
oracle.fmwplatform.envspec.model.blueprint
Classes used to describe a Blueprint.
oracle.fmwplatform.envspec.model.blueprint.coherence
Classes used to describe a Blueprint.
oracle.fmwplatform.envspec.model.blueprint.jms
Classes used to describe a Blueprint.
oracle.fmwplatform.envspec.model.blueprint.soa
Classes used to describe a Blueprint.
oracle.fmwplatform.envspec.model.domain
Classes used to describe a DomainProfile.
oracle.fmwplatform.envspec.model.domaininfo  
oracle.fmwplatform.envspec.model.targets  
oracle.fmwplatform.envspec.model.targets.types  
oracle.fmwplatform.envspec.model.topology
Classes used to describe a Topology.
oracle.fmwplatform.envspec.model.topology.coherence
Classes used to describe JMS topology.
oracle.fmwplatform.envspec.model.topology.jms
Classes used to describe JMS topology.
oracle.fmwplatform.envspec.model.topology.products
Classes used to describe a deployed products in the Topology.
oracle.fmwplatform.envspec.model.topology.products.wcc  
oracle.fmwplatform.envspec.model.tuning
Classes used to describe TuningParameters.
oracle.fmwplatform.envspec.upgrade  
oracle.fmwplatform.envspec.validation
This package contains classes that are used for reporting on the results of model validation routines.
oracle.fmwplatform.envspec.validation.annotations  
oracle.fmwplatform.envspec.validation.validators  
oracle.fmwplatform.envspec.versioning
This package contains classes that are used to describe versions and ranges of versions.
oracle.fmwplatform.util.logging  

Fusion Middleware Environment Specification

The Fusion Middleware Environment Specification defines a common format for describing Fusion Middleware environments and the applications that are deployed into those environments. This format can be consumed by various Fusion Middleware lifecycle tools.

The Environment Specification is made up of the following parts:

Standard blueprints are provided with products. Users can define a topology using these standard blueprints directly, or can define their own blueprints either from scratch, or by combining and customizing the standard blueprints.

The example code below demonstrates how these model classes can be used to construct a model.

    EnvironmentModel environmentModel = new EnvironmentModel();
    Topology topology = new Topology();
    environmentModel.setTopology(topology);

    // In a normal use case, we should read in a wallet to create the
    // Credentials object
    environmentModel.setCredentials(new Credentials());

    // Create a domain and add it to the topology
    Domain domain = new Domain();
    domain.setId("domain3");
    domain.setPath("/scratch/test/domain3");
    domain.setType(Type.LOCAL);
    topology.addDomain(domain);
    // Create a Managed Server for the domain
    Server managedServer = new Server();

    // Server and Cluster are children of the domain profile
    DomainProfile domainProfile = new DomainProfile();
    // Add the domain profile to the domain
    domain.setDomainProfile(domainProfile);
    // Add the servers to the domain profile
    domainProfile.getServers().add(managedServer);

    // Load a Blueprint from the Oracle delivered model files. This same technique can be used for loading Blueprints,
    // DomainProfiles and TuningParameters

    // If running from an OracleHome you can instantiate the EnvironmentModelFileLocator with the oracle home
    // and it will not be necessary to add a path as we do in this unit test below.
    EnvironmentModelFileLocator locator = new EnvironmentModelFileLocator()
    .prependModelSearchLocation("../models/src/main/resources/models");
    domainProfile.addBlueprint("standard-soa-blueprint", null, locator);

    // Load a DomainProfile from the Oracle delivered model files and add it to the DomainProfile.
    DomainProfile loadedDomainProfile = locator.locateDomainProfile("standard-soa", null);
    if (loadedDomainProfile == null) {
      assert (loadedDomainProfile != null);
    }
    domainProfile.setDomainProfile(loadedDomainProfile);

    // Give the Servers IDs so that we can reference them from the Bindings
    managedServer.setId("managed1");

    // Create server bindings and add them to the domain
    ServerBinding managedServerBinding = new ServerBinding();
    ServerBinding soaAdminServerBinding = new ServerBinding();
    ServerBinding soaServerBinding = new ServerBinding();
    ClusterBinding soaClusterBinding = new ClusterBinding();
    domain.addServerBinding(managedServerBinding);
    domain.addServerBinding(soaAdminServerBinding);
    domain.addServerBinding(soaServerBinding);
    domain.addClusterBinding(soaClusterBinding);

    // Reference the servers from their bindings
    managedServerBinding.setServerRef(managedServer.getId());

    // ... and the servers and cluster from the loaded DomainProfile
    soaAdminServerBinding.setServerRef("AdminServer");
    soaServerBinding.setServerRef("soa_server1");
    soaClusterBinding.setClusterRef("soa_cluster");

    // Use the bindings to give the servers a name, listen address, and
    // listen port
    soaAdminServerBinding.setName("AdminServer");
    soaAdminServerBinding.setListenAddress("localhost");
    soaAdminServerBinding.setListenPort("7001");

    soaServerBinding.setName("managed-2");
    soaServerBinding.setListenAddress("localhost");
    soaServerBinding.setListenPort("7002");
    soaServerBinding.addSetting("AutoRestart", "true");
    soaServerBinding.addSetting("RestartIntervalSeconds", "300");
    soaServerBinding.addSetting("StuckThreadCount", "10");

    managedServerBinding.setName("managed-1");
    managedServerBinding.setListenAddress("localhost");
    managedServerBinding.setListenPort("7001");
    managedServerBinding.addSetting("AutoRestart", "true");
    managedServerBinding.addSetting("RestartIntervalSeconds", "300");
    managedServerBinding.addSetting("StuckThreadCount", "10");

    // Use the cluster binding to give the cluster a name and set additional
    // parameters
    soaClusterBinding.setName("cluster-1");
    soaClusterBinding.addSetting("ClusterMessagingMode", "multicast");
    soaClusterBinding.addSetting("MulticastAddress", "222.222.222.222");
    soaClusterBinding.addSetting("MulticastPort", "5001");

    // validate the model
    ValidationResult results = environmentModel.validate();

One should note that there are alternatives to using this API to manually construct the model. Users may also create XML or JSON files and use the builders to create the model from the files.

EnvironmentModel instances can be passed as input to any action written against the FMW Action Framework specification.

Skip navigation links
Oracle® Fusion Middleware Java API Reference for the Lifecycle Management Environment Specification
12c (12.2.1.3)

E95511-02

Copyright © 2014, 2019, Oracle and/or its affiliates. All rights reserved.