Search in sources :

Example 1 with BundleWireDTO

use of org.osgi.framework.wiring.dto.BundleWireDTO in project felix by apache.

the class DTOFactory method createBundleWireDTO.

private static BundleWireDTO createBundleWireDTO(Wire wire, Set<BundleRevisionDTO> resources, Set<NodeDTO> nodes) {
    BundleWireDTO wdto = new BundleWireDTO();
    if (wire instanceof BundleWire) {
        BundleWire w = (BundleWire) wire;
        BundleWiring pw = w.getProviderWiring();
        addWiringNodeIfNotPresent(pw, resources, nodes);
        wdto.providerWiring = getWiringID(pw);
        BundleWiring rw = w.getRequirerWiring();
        addWiringNodeIfNotPresent(rw, resources, nodes);
        wdto.requirerWiring = getWiringID(rw);
    }
    wdto.provider = getResourceIDAndAdd(wire.getProvider(), resources);
    wdto.requirer = getResourceIDAndAdd(wire.getRequirer(), resources);
    wdto.capability = new CapabilityRefDTO();
    wdto.capability.capability = getCapabilityID(wire.getCapability());
    wdto.capability.resource = getResourceIDAndAdd(wire.getCapability().getResource(), resources);
    wdto.requirement = new RequirementRefDTO();
    wdto.requirement.requirement = getRequirementID(wire.getRequirement());
    wdto.requirement.resource = getResourceIDAndAdd(wire.getRequirement().getResource(), resources);
    return wdto;
}
Also used : CapabilityRefDTO(org.osgi.resource.dto.CapabilityRefDTO) BundleWiring(org.osgi.framework.wiring.BundleWiring) RequirementRefDTO(org.osgi.resource.dto.RequirementRefDTO) BundleWireDTO(org.osgi.framework.wiring.dto.BundleWireDTO) BundleWire(org.osgi.framework.wiring.BundleWire)

Aggregations

BundleWire (org.osgi.framework.wiring.BundleWire)1 BundleWiring (org.osgi.framework.wiring.BundleWiring)1 BundleWireDTO (org.osgi.framework.wiring.dto.BundleWireDTO)1 CapabilityRefDTO (org.osgi.resource.dto.CapabilityRefDTO)1 RequirementRefDTO (org.osgi.resource.dto.RequirementRefDTO)1