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

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


                      public boolean addingService(ServiceReference reference) {
                          return DependencyProperties.match(reference, m_dependency);
                      }
 
                      public void addedService(ServiceReference reference) {
                          ServiceRankingInterceptor interceptor = (ServiceRankingInterceptor) m_rankingInterceptorTracker
                                  .getService(reference);
                          if (interceptor != null) {
                              setRankingInterceptor(interceptor);
                          } else {
                              m_dependency.getComponentInstance().getFactory().getLogger().log(Log.ERROR,
                                      "Cannot retrieve the interceptor object from service reference " + reference
                                              .getProperty(Constants.SERVICE_ID) + " - " + reference.getProperty
                                              (Factory.INSTANCE_NAME_PROPERTY));
                          }
                      }
 
                      public void modifiedService(ServiceReference reference, Object service) {
                          // Not supported yet.
                          // TODO it would be nice to support the modification of the interceptor TARGET property.
                      }
 
                      public void removedService(ServiceReference reference, Object service) {
                          if (service == m_rankingInterceptor) {
                              m_rankingInterceptor.close(m_dependency);
                              // Do we have another one ?
                              ServiceReference anotherReference = m_rankingInterceptorTracker.getServiceReference();
                              if (anotherReference != null) {
                                  ServiceRankingInterceptor interceptor = (ServiceRankingInterceptor) m_rankingInterceptorTracker
                                          .getService(anotherReference);
                                  if (interceptor != null) setRankingInterceptor(interceptor);
                              } else if (m_comparator != null) {
                                  // If we have a comparator, we restore the comparator.
                                  setComparator(m_comparator);
View Full Code Here


                    public boolean addingService(ServiceReference reference) {
                        return DependencyProperties.match(reference, m_dependency);
                    }

                    public void addedService(ServiceReference reference) {
                        ServiceRankingInterceptor interceptor = (ServiceRankingInterceptor) m_rankingInterceptorTracker
                                .getService(reference);
                        if (interceptor != null) {
                            setRankingInterceptor(interceptor);
                        } else {
                            m_dependency.getComponentInstance().getFactory().getLogger().log(Log.ERROR,
                                    "Cannot retrieve the interceptor object from service reference " + reference
                                            .getProperty(Constants.SERVICE_ID) + " - " + reference.getProperty
                                            (Factory.INSTANCE_NAME_PROPERTY));
                        }
                    }

                    public void modifiedService(ServiceReference reference, Object service) {
                        // Not supported yet.
                        // TODO it would be nice to support the modification of the interceptor TARGET property.
                    }

                    public void removedService(ServiceReference reference, Object service) {
                        if (service == m_rankingInterceptor) {
                            m_rankingInterceptor.close(m_dependency);
                            // Do we have another one ?
                            ServiceReference anotherReference = m_rankingInterceptorTracker.getServiceReference();
                            if (anotherReference != null) {
                                ServiceRankingInterceptor interceptor = (ServiceRankingInterceptor) m_rankingInterceptorTracker
                                        .getService(anotherReference);
                                if (interceptor != null) setRankingInterceptor(interceptor);
                            } else if (m_comparator != null) {
                                // If we have a comparator, we restore the comparator.
                                setComparator(m_comparator);
View Full Code Here

TOP

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

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.