Package org.apache.geronimo.gbean

Examples of org.apache.geronimo.gbean.GBeanData$PriorityComparator


    protected AbstractName addClusteredManagerRetriever(DeploymentContext moduleContext,
            GBeanData webModuleData,
            AbstractName sessionManagerName) throws GBeanAlreadyExistsException {
        AbstractName name = newGBeanName(moduleContext, "ClusteredManagerRetriever");

        GBeanData beanData = new GBeanData(name, ClusteredManagerRetriever.GBEAN_INFO);
        beanData.setReferencePattern(ClusteredManagerRetriever.GBEAN_REF_SESSION_MANAGER, sessionManagerName);

        webModuleData.setReferencePattern(TomcatWebAppContext.GBEAN_REF_MANAGER_RETRIEVER, name);

        addGBean(moduleContext, beanData);
View Full Code Here


            List results = new ArrayList();
            AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
            Set set = kernel.listGBeans(query); // all Jetty connectors
            for (Iterator it = set.iterator(); it.hasNext();) {
                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                GBeanData data = kernel.getGBeanData(name);
                ReferencePatterns refs = data.getReferencePatterns("brokerService");
                if (containerName.equals(refs.getAbstractName())) {
                    results.add(mgr.createProxy(name, ActiveMQConnector.class.getClassLoader()));
                }
            }
            return (ActiveMQConnector[]) results.toArray(new ActiveMQConnector[results.size()]);
View Full Code Here

            List results = new ArrayList();
            AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
            Set set = kernel.listGBeans(query); // all Jetty connectors
            for (Iterator it = set.iterator(); it.hasNext();) {
                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                GBeanData data = kernel.getGBeanData(name);
                ReferencePatterns refs = data.getReferencePatterns("brokerService");
                if(containerName.equals(refs.getAbstractName())) {
                    try {
                        String testProtocol = (String) kernel.getAttribute(name, "protocol");
                        if(testProtocol != null && testProtocol.equals(protocol)) {
                            results.add(mgr.createProxy(name, ActiveMQConnector.class.getClassLoader()));
View Full Code Here

     * functional (e.g. SSL settings for a secure connector).
     */
    public JMSConnector addConnector(JMSBroker broker, String uniqueName, String protocol, String host, int port) {
        AbstractName brokerAbstractName = kernel.getAbstractNameFor(broker);
        AbstractName name = kernel.getNaming().createChildName(brokerAbstractName, uniqueName, NameFactory.GERONIMO_SERVICE);
        GBeanData connector = new GBeanData(name, TransportConnectorGBeanImpl.GBEAN_INFO);
        //todo: if SSL is supported, need to add more properties or use a different GBean?
        connector.setAttribute("protocol", protocol);
        connector.setAttribute("host", host);
        connector.setAttribute("port", new Integer(port));
        connector.setReferencePattern("brokerService", brokerAbstractName);
        EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
        if(mgr != null) {
            try {
                mgr.addGBeanToConfiguration(brokerAbstractName.getArtifact(), connector, false);
                return (JMSConnector) kernel.getProxyManager().createProxy(name, ActiveMQConnector.class.getClassLoader());
View Full Code Here

    }

    public GBeanData addGBean(String name, GBeanInfo gbeanInfo) throws GBeanAlreadyExistsException {
        if (name == null) throw new NullPointerException("name is null");
        if (gbeanInfo == null) throw new NullPointerException("gbean is null");
        GBeanData gbean = new GBeanData(gbeanInfo);
        configuration.addGBean(name, gbean);
        return gbean;
    }
View Full Code Here

        return configuration.findGBeans(patterns);
    }

    public GBeanData getGBeanInstance(AbstractName name) throws GBeanNotFoundException {
        Map gbeans = configuration.getGBeans();
        GBeanData gbeanData = (GBeanData) gbeans.get(name);
        if (gbeanData == null) {
            throw new GBeanNotFoundException(name);
        }
        return gbeanData;
    }
View Full Code Here

    public List<String> verify(Configuration configuration) throws DeploymentException {
        List<String> failures = new ArrayList<String>();
        for (Map.Entry<AbstractName, GBeanData> entry : this.configuration.getGBeans().entrySet()) {
            AbstractName name = entry.getKey();
            GBeanData gbean = entry.getValue();

            for (Map.Entry<String, ReferencePatterns> referenceEntry : gbean.getReferences().entrySet()) {
                String referenceName = referenceEntry.getKey();
                ReferencePatterns referencePatterns = referenceEntry.getValue();

                String failure = verifyReference(gbean, referenceName, referencePatterns, configuration);
                if (failure != null) {
                    failures.add(failure);
                }
            }

            for (ReferencePatterns referencePatterns : gbean.getDependencies()) {
                String failure = verifyDependency(name, referencePatterns, configuration);
                if (failure != null) {
                    failures.add(failure);
                }
            }
View Full Code Here

        super.setUp();
        J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "geronimo.server", "testapp", NameFactory.RESOURCE_ADAPTER_MODULE, "testmodule", TARGET_NAME, NameFactory.JMS_RESOURCE);
        kernel = KernelFactory.newInstance().createKernel(j2eeContext.getJ2eeDomainName());
        kernel.boot();

        GBeanData aow = buildGBeanData("name", TARGET_NAME, AdminObjectWrapperGBean.getGBeanInfo());
        selfName = aow.getAbstractName();
        aow.setAttribute("adminObjectInterface", MockAdminObject.class.getName());
        aow.setAttribute("adminObjectClass", MockAdminObjectImpl.class.getName());
        kernel.loadGBean(aow, this.getClass().getClassLoader());

        kernel.startGBean(selfName);
    }
View Full Code Here

                    webs.add(kernel.getAttribute(name, "contextPath").toString());
                }

                int stateValue = kernel.getGBeanState(name);
                if (stateValue != State.RUNNING_INDEX) {
                    GBeanData data = kernel.getGBeanData(name);
                    State state = State.fromInt(stateValue);
                    StringBuffer buf = new StringBuffer();
                    buf.append("(").append(state.getName());
                    // Since it's not unusual for a failure to be caused by a port binding failure
                    //    we'll see if there's a likely looking port attribute in the config data
                    //    for the GBean.  It's a long shot, but hey.
                    if (data != null && data.getAttributes() != null) {
                        Map map = data.getAttributes();
                        for (Iterator it2 = map.keySet().iterator(); it2.hasNext();) {
                            String att = (String) it2.next();
                            if (att.equals("port") || att.indexOf("Port") > -1) {
                                buf.append(",").append(att).append("=").append(map.get(att));
                            }
View Full Code Here

            throw new IllegalArgumentException("Cannot access keystore "+test.getAbsolutePath()+"!");
        }
        AbstractName aName;
        AbstractName myName = kernel.getAbstractNameFor(this);
        aName = kernel.getNaming().createSiblingName(myName, name, NameFactory.KEYSTORE_INSTANCE);
        GBeanData data = new GBeanData(aName, FileKeystoreInstance.getGBeanInfo());
        try {
            String path = configuredDir.toString();
            if(!path.endsWith("/")) {
                path += "/";
            }
            data.setAttribute("keystorePath", new URI(path +name));
        } catch (URISyntaxException e) {
            throw new IllegalStateException("Can't resolve keystore path: "+e.getMessage(), e);
        }
        data.setReferencePattern("ServerInfo", kernel.getAbstractNameFor(serverInfo));
        data.setAttribute("keystoreName", name);
        if(type == null) {
            if(name.lastIndexOf(".") == -1) {
                type = KeystoreUtil.defaultType;
                log.warn("keystoreType for new keystore \""+name+"\" set to default type \""+type+"\".");
            } else {
                type = name.substring(name.lastIndexOf(".")+1);
                log.warn("keystoreType for new keystore \""+name+"\" set to \""+type+"\" based on file extension.");
            }
        }
        data.setAttribute("keystoreType", type);
        EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
        if(mgr != null) {
            try {
                mgr.addGBeanToConfiguration(myName.getArtifact(), data, true);
                return (KeystoreInstance) kernel.getProxyManager().createProxy(aName, KeystoreInstance.class);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gbean.GBeanData$PriorityComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.