Examples of GBeanInfo


Examples of org.apache.geronimo.gbean.GBeanInfo

    private GBeanData setUpDynamicGBean(GBeanInfoBuilder infoBuilder, ConfigPropertyType[] configProperties, ClassLoader cl) throws DeploymentException {
        for (int i = 0; i < configProperties.length; i++) {
            infoBuilder.addAttribute(new DynamicGAttributeInfo(configProperties[i].getConfigPropertyName().getStringValue().trim(), configProperties[i].getConfigPropertyType().getStringValue().trim(), true, false, true, true));
        }

        GBeanInfo gbeanInfo = infoBuilder.getBeanInfo();
        GBeanData gbeanData = new GBeanData(gbeanInfo);
        for (int i = 0; i < configProperties.length; i++) {
            if (configProperties[i].isSetConfigPropertyValue()) {
                gbeanData.setAttribute(configProperties[i].getConfigPropertyName().getStringValue(),
                        getValue(configProperties[i].getConfigPropertyType().getStringValue(),
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

            name = ObjectName.getInstance(objectName);
        } catch (MalformedObjectNameException e) {
            throw new IllegalArgumentException("Invalid object name '" + objectName + "': " + e.getMessage());
        }
        try {
            GBeanInfo info = kernel.getGBeanInfo(name);
            boolean found = false;
            Set intfs = info.getInterfaces();
            for (Iterator it = intfs.iterator(); it.hasNext();) {
                String intf = (String) it.next();
                if (intf.equals(JettyWebConnector.class.getName())) {
                    found = true;
                }
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

        } catch (MalformedObjectNameException e) {
            throw new DeploymentException("Could not construct connection manager object name", e);
        }

        // create the data holder for our connection manager
        GBeanInfo gbeanInfo;
        try {
            gbeanInfo = GBeanInfo.getGBeanInfo("org.apache.geronimo.connector.outbound.GenericConnectionManagerGBean", cl);
        } catch (InvalidConfigurationException e) {
            throw new DeploymentException("Unable to create GMBean", e);
        }
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

        }
        return null;
    }

    private ProxyInvoker[] createKernelGBeanInvokers(Kernel kernel, ObjectName objectName, Class proxyType) {
        GBeanInfo info;
        try {
            info = kernel.getGBeanInfo(objectName);
        } catch (Exception e) {
            throw new IllegalArgumentException("Could not get GBeanInfo for target object: " + objectName);
        }

        // build attributeName->attributeInfo map
        Set attributeInfos = info.getAttributes();
        Set attributeNames = new HashSet(attributeInfos.size());
        for (Iterator iterator = attributeInfos.iterator(); iterator.hasNext();) {
            GAttributeInfo attributeInfo = (GAttributeInfo) iterator.next();
            attributeNames.add(attributeInfo.getName());
        }

        // build operationSignature->operationInfo map
        Set operationInfos = info.getOperations();
        Set operationSignatures = new HashSet(operationInfos.size());
        for (Iterator iterator = operationInfos.iterator(); iterator.hasNext();) {
            GOperationInfo operationInfo = (GOperationInfo) iterator.next();
            operationSignatures.add(new GOperationSignature(operationInfo.getName(), operationInfo.getParameterList()));
        }
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

                    failed.put(name, buf.toString());
                    continue;
                }

                // Check if this is ServerInfo
                GBeanInfo info = kernel.getGBeanInfo(name);
                if(info.getClassName().equals("org.apache.geronimo.system.serverinfo.ServerInfo")) {
                    serverInfo = (String) kernel.getAttribute(name, "version");
                }

                // Look for any SocketAddress properties
                List list = (List) beanInfos.get(info);
                if(list == null) {
                    list = new ArrayList(3);
                    beanInfos.put(info, list);
                    Set atts = info.getAttributes();
                    for (Iterator it2 = atts.iterator(); it2.hasNext();) {
                        GAttributeInfo att = (GAttributeInfo) it2.next();
                        if(att.getType().equals("java.net.InetSocketAddress")) {
                            list.add(att);
                        }
                    }
                }
                for (int i = 0; i < list.size(); i++) {
                    GAttributeInfo att = (GAttributeInfo) list.get(i);
                    try {
                        InetSocketAddress addr = (InetSocketAddress) kernel.getAttribute(name, att.getName());
                        if(addr == null) {
                            log.debug("No value for GBean "+name+" attribute "+att.getName());
                            continue;
                        } else if(addr.getAddress() == null || addr.getAddress().getHostAddress() == null) {
                            log.debug("Null address or host for GBean "+name+" "+att.getName()+": "+addr.getAddress());
                        }
                        String attName = info.getName();
                        if(list.size() > 1) {
                            attName += " "+decamelize(att.getName());
                        } else if(info.getAttribute("name") != null) {
                            attName += " "+kernel.getAttribute(name, "name");
                        }
                        ports.add(new AddressHolder(attName, addr));
                    } catch (IllegalStateException e) {
                        // We weren't able to load a port for this service -- that's a bummer
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

    public void testProperties() throws Exception {
        try {
            log("testProperties():");

            GBeanInfo gbi = InteropGBean.getGBeanInfo();
            log("testProperties(): gbi = " + gbi);

//            GBeanMBean cmf = new GBeanMBean(gbi);
//            log("testProperties(): cmf = " + cmf);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

            throw new IllegalStateException("How can *:* be an invalid pattern");
        }
        for (Iterator it = all.iterator(); it.hasNext();) {
            ObjectName name = (ObjectName) it.next();
            try {
                GBeanInfo info = getGBeanData(name).getGBeanInfo();
                Set intfs = info.getInterfaces();
                for (int i = 0; i < interfaces.length; i++) {
                    String candidate = interfaces[i];
                    if(intfs.contains(candidate)) {
                        gbeans.add(name);
                        break;
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

        artifactResolverGBean.setReferencePattern("ArtifactManager", artifactManagerGBean.getAbstractName());

        Set storeNames = new HashSet();

        // Source config store
        GBeanInfo configStoreInfo = GBeanInfo.getGBeanInfo(MavenConfigStore.class.getName(), cl);
        GBeanData storeGBean = bootstrap.addGBean("ConfigStore", configStoreInfo);
        if (configStoreInfo.getReference("Repository") != null) {
            storeGBean.setReferencePattern("Repository", repoGBean.getAbstractName());
        }
        storeNames.add(storeGBean.getAbstractName());

        // Target config store
        GBeanInfo targetConfigStoreInfo = GBeanInfo.getGBeanInfo(RepositoryConfigurationStore.class.getName(), cl);
        GBeanData targetStoreGBean = bootstrap.addGBean("TargetConfigStore", targetConfigStoreInfo);
        if (targetConfigStoreInfo.getReference("Repository") != null) {
            targetStoreGBean.setReferencePattern("Repository", targetRepoGBean.getAbstractName());
        }
        storeNames.add(targetStoreGBean.getAbstractName());

        targetConfigStoreAName = targetStoreGBean.getAbstractName();
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

     */
    public Collection getAttributes(String abstractName) {
        Map attributes = new TreeMap();
        try {
            AbstractName aname = new AbstractName(URI.create(abstractName));
            GBeanInfo info = kernel.getGBeanInfo(aname);
            Set attribs = info.getAttributes();
            for (Iterator i = attribs.iterator(); i.hasNext();) {
                GAttributeInfo attribInfo = (GAttributeInfo) i.next();
                // Don't include 'GBeanInfo' attributes
                String attribName = attribInfo.getName();
                if (!GBEANINFO_NAME.equals(attribName)) {
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanInfo

     */
    public Collection getOperations(String abstractName) {
        Map operations = new TreeMap();
        try {
            AbstractName aname = new AbstractName(URI.create(abstractName));
            GBeanInfo info = kernel.getGBeanInfo(aname);
            Set opers = info.getOperations();
            for (Iterator i = opers.iterator(); i.hasNext();) {
                GOperationInfo operInfo = (GOperationInfo) i.next();
                Map operInfoMap = getOperInfoAsMap(operInfo);
                String operName = (String) operInfoMap.get("name");
                operations.put(operName, operInfoMap);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.