|
Glassfish example source code file (Domain.java)
The Glassfish Domain.java source code/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html * or packager/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at packager/legal/LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package com.sun.enterprise.config.serverbeans; import org.glassfish.api.admin.config.ReferenceContainer; import org.jvnet.hk2.config.types.PropertyBag; import org.glassfish.api.admin.config.ApplicationName; import org.glassfish.api.admin.config.PropertiesDesc; import org.jvnet.hk2.config.types.Property; import org.glassfish.api.admin.config.PropertyDesc; import org.glassfish.quality.ToDo; import org.jvnet.hk2.component.Injectable; import org.jvnet.hk2.config.Attribute; import org.jvnet.hk2.config.ConfigBeanProxy; import org.jvnet.hk2.config.Configured; import org.jvnet.hk2.config.DuckTyped; import org.jvnet.hk2.config.Element; import com.sun.enterprise.util.StringUtils; import javax.validation.constraints.NotNull; import java.beans.PropertyVetoException; import java.util.*; import java.util.logging.Logger; @Configured /** * Top level Domain Element that includes applications, resources, configs, * servers, clusters and node-agents, load balancer configurations and load * balancers. node-agents and load balancers are SE/EE related entities only. * */ public interface Domain extends ConfigBeanProxy, Injectable, PropertyBag, SystemPropertyBag { public static final String DOMAIN_NAME_PROPERTY = "administrative.domain.name"; /** * Gets the value of the applicationRoot property. * * For PE this defines the location where applications are deployed * * @return possible object is * {@link String } */ @Attribute String getApplicationRoot(); /** * Sets the value of the applicationRoot property. * * @param value allowed object is * {@link String } */ void setApplicationRoot(String value) throws PropertyVetoException; /** * Gets the value of the logRoot property. * * Specifies where the server instance's log files are kept, including * HTTP access logs, server logs, and transaction logs. * Default is $INSTANCE-ROOT/logs * * @return possible object is * {@link String } */ @Attribute String getLogRoot(); /** * Sets the value of the logRoot property. * * @param value allowed object is * {@link String } */ void setLogRoot(String value) throws PropertyVetoException; /** * Gets the value of the locale property. * * @return possible object is * {@link String } */ @Attribute String getLocale(); /** * Sets the value of the locale property. * * @param value allowed object is * {@link String } */ void setLocale(String value) throws PropertyVetoException; /** * Gets the value of the version property. It is read-only. * * Tools are not to depend on this property. It is only for reference. * * @return String representing version of the Domain. */ @Attribute String getVersion(); /** * Gets the SecureAdmin value defined in the domain. * @return {@link SecureAdmin } */ @Element SecureAdmin getSecureAdmin(); /** * Sets the SecureAdmin value. * @param secureAdmin */ void setSecureAdmin(SecureAdmin secureAdmin); /** * Gets the value of the applications property. * * @return possible object is * {@link Applications } */ @Element @NotNull Applications getApplications(); /** * Sets the value of the system-applications property. * * @param value allowed object is * {@link Applications } */ void setApplications(Applications value) throws PropertyVetoException; @Element @NotNull SystemApplications getSystemApplications(); /** * Sets the value of the system-applications property. * * @param value allowed object is * {@link Applications } */ void setSystemApplications(SystemApplications value) throws PropertyVetoException; /** * Gets the value of the resources property. * * @return possible object is * {@link Resources } */ @Element @NotNull Resources getResources(); /** * Sets the value of the resources property. * * @param value allowed object is * {@link Resources } */ void setResources(Resources value) throws PropertyVetoException; /** * Gets the value of the configs property. * * @return possible object is * {@link Configs } */ @Element(required=true) @NotNull Configs getConfigs(); /** * Sets the value of the configs property. * * @param value allowed object is * {@link Configs } */ void setConfigs(Configs value) throws PropertyVetoException; /** * Gets the value of the servers property. * * @return possible object is * {@link Servers } */ @Element(required=true) @NotNull Servers getServers(); /** * Sets the value of the servers property. * * @param value allowed object is * {@link Servers } */ void setServers(Servers value) throws PropertyVetoException; /** * Gets the value of the clusters property. * * @return possible object is * {@link Clusters } */ @Element @NotNull Clusters getClusters(); /** * Sets the value of the clusters property. * * @param value allowed object is * {@link Clusters } */ void setClusters(Clusters value) throws PropertyVetoException; /** * Gets the value of the nodes property. * * @return possible object is * {@link Nodes } */ @Element Nodes getNodes(); /** * Sets the value of the nodes property. * * @param value allowed object is * {@link Nodes } */ void setNodes(Nodes value) throws PropertyVetoException; /** * Gets the value of the nodeAgents property. * * @return possible object is * {@link NodeAgents } */ @Element NodeAgents getNodeAgents(); /** * Sets the value of the nodeAgents property. * * @param value allowed object is * {@link NodeAgents } */ void setNodeAgents(NodeAgents value) throws PropertyVetoException; /** * Gets the value of the lbConfigs property. * * @return possible object is * {@link LbConfigs } */ @Element @NotNull LbConfigs getLbConfigs(); /** * Sets the value of the lbConfigs property. * * @param value allowed object is * {@link LbConfigs } */ void setLbConfigs(LbConfigs value) throws PropertyVetoException; /** * Gets the value of the loadBalancers property. * * @return possible object is * {@link LoadBalancers } */ @Element @NotNull LoadBalancers getLoadBalancers(); /** * Sets the value of the loadBalancers property. * * @param value allowed object is * {@link LoadBalancers } */ void setLoadBalancers(LoadBalancers value) throws PropertyVetoException; @Element public AmxPref getAmxPref(); public void setAmxPref(final AmxPref amxPrefs) throws PropertyVetoException; /** * Gets the value of the systemProperty property. * <p/> * <p/> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set method for the systemProperty property. * <p/> * <p/> * For example, to add a new item, do as follows: * <pre> * getSystemProperty().add(newItem); * </pre> * <p/> * <p/> * <p/> * Objects of the following type(s) are allowed in the list * {@link SystemProperty } */ @ToDo(priority=ToDo.Priority.IMPORTANT, details="Any more legal system properties?" ) @PropertiesDesc( systemProperties=true, props={ @PropertyDesc(name="com.sun.aas.installRoot", description="Operating system dependent. Path to the directory where the server is installed"), @PropertyDesc(name="com.sun.aas.instanceRoot", description="Operating system dependent. Path to the top level directory for a server instance"), @PropertyDesc(name="com.sun.aas.hostName", description="Operating system dependent. Path to the name of the host (machine)"), @PropertyDesc(name="com.sun.aas.javaRoot", description="Operating system dependent. Path to the library directory for the Sun GlassFish Message Queue software"), @PropertyDesc(name="com.sun.aas.imqLib", description="Operating system dependent. Path to the installation directory for the Java runtime"), @PropertyDesc(name="com.sun.aas.imqLib", description="Operating system dependent. Path to the installation directory for the Java runtime"), @PropertyDesc(name="com.sun.aas.configName", defaultValue="server-config", description="Name of the <config> used by a server instance"), @PropertyDesc(name="com.sun.aas.instanceName", defaultValue="server1", description="Name of the server instance. Not used in the default configuration, but can be used to customize configuration"), @PropertyDesc(name="com.sun.aas.domainName", defaultValue="domain1", description="Name of the domain. Not used in the default configuration, but can be used to customize configuration") } ) @Element List<SystemProperty> getSystemProperty(); /** Properties as per {@link PropertyBag} */ @ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" ) @PropertiesDesc(props={}) @Element List<Property> getProperty(); @DuckTyped String getName(); @DuckTyped List<Application> getAllDefinedSystemApplications(); @DuckTyped ApplicationRef getApplicationRefInServer(String sn, String name); @DuckTyped List<ApplicationRef> getApplicationRefsInServer(String sn); /** * Returns the list of system-applications that are referenced from the given server. * A server references an application, if the server has an element named * <application-ref> in it that points to given application. The given server * is a <server> element inside domain. * * @param sn the string denoting name of the server * @return List of system-applications for that server, an empty list in case there is none */ @DuckTyped List<Application> getSystemApplicationsReferencedFrom(String sn); @DuckTyped Application getSystemApplicationReferencedFrom(String sn, String appName); @DuckTyped boolean isNamedSystemApplicationReferencedFrom(String appName, String serverName); @DuckTyped Server getServerNamed(String name); @DuckTyped boolean isServer(String name); @DuckTyped Config getConfigNamed(String name); @DuckTyped Cluster getClusterNamed(String name); @DuckTyped Node getNodeNamed(String name); @DuckTyped boolean isCurrentInstanceMatchingTarget(String target, String appName, String currentInstance, List<String> referencedTargets); @DuckTyped List<Server> getServersInTarget(String target); @DuckTyped List<ApplicationRef> getApplicationRefsInTarget(String target); @DuckTyped ApplicationRef getApplicationRefInTarget(String appName, String target); @DuckTyped ApplicationRef getApplicationRefInTarget(String appName, String target, boolean includeInstances); @DuckTyped boolean isAppRefEnabledInTarget(String appName, String target); @DuckTyped boolean isAppEnabledInTarget(String appName, String target); @DuckTyped List<String> getAllReferencedTargetsForApplication(String appName); @DuckTyped List<String> getAllTargets(); @DuckTyped List<Application> getApplicationsInTarget(String target); @DuckTyped String getVirtualServersForApplication(String target, String appName); @DuckTyped String getEnabledForApplication(String target, String appName); @DuckTyped ReferenceContainer getReferenceContainerNamed(String name); @DuckTyped Cluster getClusterForInstance(String instanceName); @DuckTyped List<ReferenceContainer> getAllReferenceContainers(); @DuckTyped List<ReferenceContainer> getReferenceContainersOf(Config config); @DuckTyped List<Server> getInstancesOnNode(String nodeName); @DuckTyped List<Cluster> getClustersOnNode(String nodeName); class Duck { public static String getName(Domain domain) { return domain.getPropertyValue(DOMAIN_NAME_PROPERTY); } /* return an empty list if given garbage -- or errors are encountered * or if no matches */ public static List<Server> getInstancesOnNode(Domain domain, String nodeName) { List<Server> ret = new LinkedList Other Glassfish examples (source code examples)Here is a short list of links related to this Glassfish Domain.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.