Package org.apache.felix.ipojo.dependency.interceptors

Examples of org.apache.felix.ipojo.dependency.interceptors.TransformedServiceReference


            // Recompute the matching services.
            m_matchingReferences.clear();
            final List<ServiceReference> serviceReferencesList = m_dependency.getTracker().getServiceReferencesList();
            if (serviceReferencesList != null) {
                for (ServiceReference reference : serviceReferencesList) {
                    TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
                    ref = accept(ref);
                    if (ref != null) {
                        m_matchingReferences.put(reference, ref);
                    }
                }
View Full Code Here


    public void addedService(ServiceReference reference) {
        // A service was added to the tracker.

        // First, check is the tracking interceptors are accepting it.
        // The transformed reference is creates and check outside of the protected region.
        TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);

        boolean match;
        try {
            m_dependency.acquireWriteLockIfNotHeld();
            ref = accept(ref);
View Full Code Here

        try {
            m_dependency.acquireWriteLockIfNotHeld();

            if (m_matchingReferences.containsKey(reference)) {
                // do we still accept the reference
                TransformedServiceReference initial = m_matchingReferences.get(reference);
                TransformedServiceReference accepted = new TransformedServiceReferenceImpl(reference);
                accepted = accept(accepted);
                if (accepted == null) {
                    // case 1
                    m_matchingReferences.remove(reference);
                    onDepartureOfAMatchingService(initial, service);
                    eventType = DEPARTURE;
                    eventRef = initial;
                } else {
                    // Do we have a real change
                    if (!ServiceReferenceUtils.haveSameProperties(initial, accepted)) {
                        // case 3
                        m_matchingReferences.put(reference, accepted);
                        onModificationOfAMatchingService(accepted, service);
                        eventType = MODIFIED;
                        eventRef = accepted;
                    }
                }
            } else {
                // Base does not contain the service, let's try to add it.
                TransformedServiceReference transformed = new TransformedServiceReferenceImpl(reference);
                transformed = accept(transformed);
                if (transformed != null) {
                    // case 2
                    m_matchingReferences.put(reference, transformed);
                    onNewMatchingService(transformed);
View Full Code Here

    public void removedService(ServiceReference reference, Object service) {
        // A service is leaving
        // 1 - the service was in the matching set => real departure
        // 2 - the service was not in the matching set => nothing do do.

        TransformedServiceReference initial = null;
        try {
            m_dependency.acquireWriteLockIfNotHeld();
            initial = m_matchingReferences.remove(reference);
            if (initial != null) {
                // Case 1
View Full Code Here

                // Recompute the matching services.
                m_matchingReferences.clear();
                final List<ServiceReference> serviceReferencesList = tracker.getServiceReferencesList();
                if (serviceReferencesList != null) {
                    for (ServiceReference reference : serviceReferencesList) {
                        TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
                        ref = accept(ref);
                        if (ref != null) {
                            m_matchingReferences.put(reference, ref);
                        }
                    }
View Full Code Here

            // Recompute the matching services.
            m_matchingReferences.clear();
            final List<ServiceReference> serviceReferencesList = m_dependency.getTracker().getServiceReferencesList();
            if (serviceReferencesList != null) {
                for (ServiceReference reference : serviceReferencesList) {
                    TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
                    ref = accept(ref);
                    if (ref != null) {
                        m_matchingReferences.put(reference, ref);
                    }
                }
View Full Code Here

    public void addedService(ServiceReference reference) {
        // A service was added to the tracker.

        // First, check is the tracking interceptors are accepting it.
        // The transformed reference is creates and check outside of the protected region.
        TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);

        boolean match;
        try {
            m_dependency.acquireWriteLockIfNotHeld();
            ref = accept(ref);
View Full Code Here

        try {
            m_dependency.acquireWriteLockIfNotHeld();

            if (m_matchingReferences.containsKey(reference)) {
                // do we still accept the reference
                TransformedServiceReference initial = m_matchingReferences.get(reference);
                TransformedServiceReference accepted = new TransformedServiceReferenceImpl(reference);
                accepted = accept(accepted);
                if (accepted == null) {
                    // case 1
                    m_matchingReferences.remove(reference);
                    onDepartureOfAMatchingService(initial, service);
                    eventType = DEPARTURE;
                    eventRef = initial;
                } else {
                    // Do we have a real change
                    if (!ServiceReferenceUtils.haveSameProperties(initial, accepted)) {
                        // case 3
                        m_matchingReferences.put(reference, accepted);
                        onModificationOfAMatchingService(accepted, service);
                        eventType = MODIFIED;
                        eventRef = accepted;
                    }
                }
            } else {
                // Base does not contain the service, let's try to add it.
                TransformedServiceReference transformed = new TransformedServiceReferenceImpl(reference);
                transformed = accept(transformed);
                if (transformed != null) {
                    // case 2
                    m_matchingReferences.put(reference, transformed);
                    onNewMatchingService(transformed);
View Full Code Here

    public void removedService(ServiceReference reference, Object service) {
        // A service is leaving
        // 1 - the service was in the matching set => real departure
        // 2 - the service was not in the matching set => nothing do do.

        TransformedServiceReference initial = null;
        try {
            m_dependency.acquireWriteLockIfNotHeld();
            initial = m_matchingReferences.remove(reference);
            if (initial != null) {
                // Case 1
View Full Code Here

                // Recompute the matching services.
                m_matchingReferences.clear();
                final List<ServiceReference> serviceReferencesList = tracker.getServiceReferencesList();
                if (serviceReferencesList != null) {
                    for (ServiceReference reference : serviceReferencesList) {
                        TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
                        ref = accept(ref);
                        if (ref != null) {
                            m_matchingReferences.put(reference, ref);
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.dependency.interceptors.TransformedServiceReference

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.