Package org.jboss.gravia.resource

Examples of org.jboss.gravia.resource.Wiring


            @Override
            public int compare(Capability cap1, Capability cap2) {

                // Prefer already wired
                if (wirings != null) {
                    Wiring w1 = wirings.get(cap1.getResource());
                    Wiring w2 = wirings.get(cap2.getResource());
                    if (w1 != null && w2 == null)
                        return -1;
                    if (w1 == null && w2 != null)
                        return +1;
                }
View Full Code Here


            this.primary = primary;

            String uniquekey = primary.getIdentity().getSymbolicName();
            resources.put(uniquekey, primary);

            Wiring wiring = primary.getWiring();
            if (wiring != null) {
                for (Wire wire : wiring.getRequiredResourceWires(null)) {
                    Resource provider = wire.getProvider();
                    uniquekey = provider.getIdentity().getSymbolicName();
                    resources.put(uniquekey, provider);
                }
            }
View Full Code Here

    public Map<Resource, Wiring> getWirings() {
        Map<Resource, Wiring> wirings = new HashMap<Resource, Wiring>();
        Iterator<Resource> itres = resourceStore.getResources();
        while (itres.hasNext()) {
            Resource res = itres.next();
            Wiring wiring = res.getWiring();
            if (wiring != null) {
                wirings.put(res, wiring);
            }
        }
        return Collections.unmodifiableMap(wirings);
View Full Code Here

        Map<Resource, Wiring> auxwirings = result.getWirings();
        for (Entry<Resource, Wiring> entry : auxwirings.entrySet()) {
            Resource auxres = entry.getKey();
            Resource envres = environment.getResource(auxres.getIdentity());
            DefaultWiring envwiring = new DefaultWiring(envres, null, null);
            Wiring auxwiring = entry.getValue();
            for (Wire auxwire : auxwiring.getProvidedResourceWires(null)) {
                Capability auxcap = auxwire.getCapability();
                Capability envcap = findTargetCapability(auxcap);
                Requirement auxreq = auxwire.getRequirement();
                Requirement envreq = findTargetRequirement(auxreq);
                envwiring.addProvidedWire(new DefaultWire(envreq, envcap));
            }
            for (Wire auxwire : auxwiring.getRequiredResourceWires(null)) {
                Capability auxcap = auxwire.getCapability();
                Capability envcap = findTargetCapability(auxcap);
                Requirement auxreq = auxwire.getRequirement();
                Requirement envreq = findTargetRequirement(auxreq);
                envwiring.addRequiredWire(new DefaultWire(envreq, envcap));
View Full Code Here

TOP

Related Classes of org.jboss.gravia.resource.Wiring

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.