org.kie.internal.runtime.conf.ObjectModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kie-internal Show documentation
Show all versions of kie-internal Show documentation
The Drools and jBPM internal API which is NOT backwards compatible between releases.
/*
* Copyright 2014 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kie.internal.runtime.conf;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
/**
* Object model that defines how and of what type the object instance should be created.
* The how is actually delegated to resolved implementation ObjectModelResolver
* that default to Java Reflection based resolver but might utilize others (such as MVEL, Spring, CDI, etc).
*
* The what type is derived from identifier (which should be FQCN in case of reflection) that is then used
* to create instance of that object using constructor. Which constructor is taken depends on defined parameters
* which might be again an ObjectModel for complex types.
* String types are supported directly, all other should be represented as ObjectModel.
*
* There are some key words acceptable that directly will refer to available instances:
*
* - runtimeManager - to get RuntimeManager instance injected
* - runtimeEngine - to get RuntimeEngine instance injected
* - ksession - to get KieSession instance injected
* - taskService - to get TaskService instance injected
*
*
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class ObjectModel implements Serializable {
private static final long serialVersionUID = 6079949171686382208L;
@XmlElement(name="resolver")
@XmlSchemaType(name="string")
private String resolver = "reflection";
@XmlElement(name="identifier")
@XmlSchemaType(name="string")
private String identifier;
@XmlElement(name="parameter")
@XmlElementWrapper(name="parameters")
private List