Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0C80117F5B for ; Thu, 12 Feb 2015 07:57:15 +0000 (UTC) Received: (qmail 53627 invoked by uid 500); 12 Feb 2015 07:57:15 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 53586 invoked by uid 500); 12 Feb 2015 07:57:15 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 53577 invoked by uid 99); 12 Feb 2015 07:57:15 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 07:57:15 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id B5EC1AC010E for ; Thu, 12 Feb 2015 07:57:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1659162 - in /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal: runtime/ whiteboard/ whiteboard/tracker/ Date: Thu, 12 Feb 2015 07:57:14 -0000 To: commits@felix.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150212075714.B5EC1AC010E@hades.apache.org> Author: cziegeler Date: Thu Feb 12 07:57:13 2015 New Revision: 1659162 URL: http://svn.apache.org/r1659162 Log: FELIX-4781 : Implement various listeners Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java (with props) felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java (with props) Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextAttributeListenerInfo.java felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextListenerInfo.java felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.http.base.internal.runtime; + +import javax.servlet.http.HttpSessionAttributeListener; + +import org.osgi.framework.ServiceReference; + +/** + * Info object for registered servlet context listeners + * + * @author Felix Project Team + */ +public final class HttpSessionAttributeListenerInfo extends ListenerInfo +{ + public HttpSessionAttributeListenerInfo(final ServiceReference ref) + { + super(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionAttributeListenerInfo.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.http.base.internal.runtime; + +import javax.servlet.http.HttpSessionListener; + +import org.osgi.framework.ServiceReference; + +/** + * Info object for registered servlet context listeners + * + * @author Felix Project Team + */ +public final class HttpSessionListenerInfo extends ListenerInfo +{ + public HttpSessionListenerInfo(final ServiceReference ref) + { + super(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/HttpSessionListenerInfo.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.http.base.internal.runtime; + +import org.osgi.framework.ServiceReference; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; + +/** + * Info object for registered listeners. + * + * @author Felix Project Team + */ +public abstract class ListenerInfo extends WhiteboardServiceInfo +{ + + private final String enabled; + + public ListenerInfo(final ServiceReference ref) + { + super(ref); + this.enabled = this.getStringProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER); + } + + @Override + public boolean isValid() + { + return super.isValid() && "true".equalsIgnoreCase(this.enabled); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextAttributeListenerInfo.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextAttributeListenerInfo.java?rev=1659162&r1=1659161&r2=1659162&view=diff ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextAttributeListenerInfo.java (original) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextAttributeListenerInfo.java Thu Feb 12 07:57:13 2015 @@ -21,27 +21,17 @@ package org.apache.felix.http.base.inter import javax.servlet.ServletContextAttributeListener; import org.osgi.framework.ServiceReference; -import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; /** * Info object for registered servlet context attribute listeners * * @author Felix Project Team */ -public final class ServletContextAttributeListenerInfo extends WhiteboardServiceInfo +public final class ServletContextAttributeListenerInfo extends ListenerInfo { - private final String enabled; - public ServletContextAttributeListenerInfo(final ServiceReference ref) { super(ref); - this.enabled = this.getStringProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER); - } - - @Override - public boolean isValid() - { - return super.isValid() && "true".equalsIgnoreCase(this.enabled); } } Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextListenerInfo.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextListenerInfo.java?rev=1659162&r1=1659161&r2=1659162&view=diff ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextListenerInfo.java (original) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextListenerInfo.java Thu Feb 12 07:57:13 2015 @@ -21,26 +21,16 @@ package org.apache.felix.http.base.inter import javax.servlet.ServletContextListener; import org.osgi.framework.ServiceReference; -import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; /** * Info object for registered servlet context listeners * * @author Felix Project Team */ -public final class ServletContextListenerInfo extends WhiteboardServiceInfo +public final class ServletContextListenerInfo extends ListenerInfo { - private final String enabled; - public ServletContextListenerInfo(final ServiceReference ref) { super(ref); - this.enabled = this.getStringProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER); - } - - @Override - public boolean isValid() - { - return super.isValid() && "true".equalsIgnoreCase(this.enabled); } } Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.http.base.internal.runtime; + +import javax.servlet.ServletRequestAttributeListener; + +import org.osgi.framework.ServiceReference; + +/** + * Info object for registered servlet context listeners + * + * @author Felix Project Team + */ +public final class ServletRequestAttributeListenerInfo extends ListenerInfo +{ + public ServletRequestAttributeListenerInfo(final ServiceReference ref) + { + super(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestAttributeListenerInfo.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.http.base.internal.runtime; + +import javax.servlet.ServletRequestListener; + +import org.osgi.framework.ServiceReference; + +/** + * Info object for registered servlet context listeners + * + * @author Felix Project Team + */ +public final class ServletRequestListenerInfo extends ListenerInfo +{ + public ServletRequestListenerInfo(final ServiceReference ref) + { + super(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletRequestListenerInfo.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java?rev=1659162&r1=1659161&r2=1659162&view=diff ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java (original) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java Thu Feb 12 07:57:13 2015 @@ -31,9 +31,12 @@ import org.apache.felix.http.base.intern import org.apache.felix.http.base.internal.runtime.ResourceInfo; import org.apache.felix.http.base.internal.runtime.ServletInfo; import org.apache.felix.http.base.internal.whiteboard.tracker.FilterTracker; +import org.apache.felix.http.base.internal.whiteboard.tracker.HttpSessionAttributeListenerTracker; +import org.apache.felix.http.base.internal.whiteboard.tracker.HttpSessionListenerTracker; import org.apache.felix.http.base.internal.whiteboard.tracker.ResourceTracker; -import org.apache.felix.http.base.internal.whiteboard.tracker.ServletContextHelperTracker; import org.apache.felix.http.base.internal.whiteboard.tracker.ServletContextListenerTracker; +import org.apache.felix.http.base.internal.whiteboard.tracker.ServletRequestAttributeListenerTracker; +import org.apache.felix.http.base.internal.whiteboard.tracker.ServletRequestListenerTracker; import org.apache.felix.http.base.internal.whiteboard.tracker.ServletTracker; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceObjects; @@ -66,8 +69,12 @@ public final class WhiteboardHttpService addTracker(new FilterTracker(bundleContext, contextManager)); addTracker(new ServletTracker(bundleContext, this.contextManager)); addTracker(new ResourceTracker(bundleContext, this.contextManager)); - addTracker(new ServletContextHelperTracker(bundleContext, this.contextManager)); + addTracker(new HttpSessionAttributeListenerTracker(bundleContext, this.contextManager)); + addTracker(new HttpSessionListenerTracker(bundleContext, this.contextManager)); addTracker(new ServletContextListenerTracker(bundleContext, this.contextManager)); + addTracker(new ServletContextListenerTracker(bundleContext, this.contextManager)); + addTracker(new ServletRequestListenerTracker(bundleContext, this.contextManager)); + addTracker(new ServletRequestAttributeListenerTracker(bundleContext, this.contextManager)); } public void close() Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.felix.http.base.internal.whiteboard.tracker; + +import javax.servlet.http.HttpSessionAttributeListener; + +import org.apache.felix.http.base.internal.runtime.HttpSessionAttributeListenerInfo; +import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo; +import org.apache.felix.http.base.internal.whiteboard.ServletContextHelperManager; +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; + +public final class HttpSessionAttributeListenerTracker extends AbstractReferenceTracker +{ + + private static org.osgi.framework.Filter createFilter(final BundleContext btx) + { + try + { + return btx.createFilter(String.format("(&(objectClass=%s)(%s=*)(!(%s~=false)))", + HttpSessionAttributeListener.class.getName(), + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER)); + } + catch ( final InvalidSyntaxException ise) + { + // we can safely ignore it as the above filter is a constant + } + return null; // we never get here - and if we get an NPE which is fine + } + + public HttpSessionAttributeListenerTracker(final BundleContext context, final ServletContextHelperManager manager) + { + super(manager, context, createFilter(context)); + } + + @Override + protected WhiteboardServiceInfo getServiceInfo(final ServiceReference ref) { + return new HttpSessionAttributeListenerInfo(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionAttributeListenerTracker.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.felix.http.base.internal.whiteboard.tracker; + +import javax.servlet.http.HttpSessionListener; + +import org.apache.felix.http.base.internal.runtime.HttpSessionListenerInfo; +import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo; +import org.apache.felix.http.base.internal.whiteboard.ServletContextHelperManager; +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; + +public final class HttpSessionListenerTracker extends AbstractReferenceTracker +{ + + private static org.osgi.framework.Filter createFilter(final BundleContext btx) + { + try + { + return btx.createFilter(String.format("(&(objectClass=%s)(%s=*)(!(%s~=false)))", + HttpSessionListener.class.getName(), + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER)); + } + catch ( final InvalidSyntaxException ise) + { + // we can safely ignore it as the above filter is a constant + } + return null; // we never get here - and if we get an NPE which is fine + } + + public HttpSessionListenerTracker(final BundleContext context, final ServletContextHelperManager manager) + { + super(manager, context, createFilter(context)); + } + + @Override + protected WhiteboardServiceInfo getServiceInfo(final ServiceReference ref) { + return new HttpSessionListenerInfo(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/HttpSessionListenerTracker.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.felix.http.base.internal.whiteboard.tracker; + +import javax.servlet.ServletRequestAttributeListener; + +import org.apache.felix.http.base.internal.runtime.ServletRequestAttributeListenerInfo; +import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo; +import org.apache.felix.http.base.internal.whiteboard.ServletContextHelperManager; +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; + +public final class ServletRequestAttributeListenerTracker extends AbstractReferenceTracker +{ + + private static org.osgi.framework.Filter createFilter(final BundleContext btx) + { + try + { + return btx.createFilter(String.format("(&(objectClass=%s)(%s=*)(!(%s~=false)))", + ServletRequestAttributeListener.class.getName(), + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER)); + } + catch ( final InvalidSyntaxException ise) + { + // we can safely ignore it as the above filter is a constant + } + return null; // we never get here - and if we get an NPE which is fine + } + + public ServletRequestAttributeListenerTracker(final BundleContext context, final ServletContextHelperManager manager) + { + super(manager, context, createFilter(context)); + } + + @Override + protected WhiteboardServiceInfo getServiceInfo(final ServiceReference ref) { + return new ServletRequestAttributeListenerInfo(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestAttributeListenerTracker.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java?rev=1659162&view=auto ============================================================================== --- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java (added) +++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java Thu Feb 12 07:57:13 2015 @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.felix.http.base.internal.whiteboard.tracker; + +import javax.servlet.ServletRequestListener; + +import org.apache.felix.http.base.internal.runtime.ServletRequestListenerInfo; +import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo; +import org.apache.felix.http.base.internal.whiteboard.ServletContextHelperManager; +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; + +public final class ServletRequestListenerTracker extends AbstractReferenceTracker +{ + + private static org.osgi.framework.Filter createFilter(final BundleContext btx) + { + try + { + return btx.createFilter(String.format("(&(objectClass=%s)(%s=*)(!(%s~=false)))", + ServletRequestListener.class.getName(), + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER)); + } + catch ( final InvalidSyntaxException ise) + { + // we can safely ignore it as the above filter is a constant + } + return null; // we never get here - and if we get an NPE which is fine + } + + public ServletRequestListenerTracker(final BundleContext context, final ServletContextHelperManager manager) + { + super(manager, context, createFilter(context)); + } + + @Override + protected WhiteboardServiceInfo getServiceInfo(final ServiceReference ref) { + return new ServletRequestListenerInfo(ref); + } +} Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java ------------------------------------------------------------------------------ svn:keywords = author date id revision rev url Propchange: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletRequestListenerTracker.java ------------------------------------------------------------------------------ svn:mime-type = text/plain