Author: nbelaevski
Date: 2010-10-07 13:26:28 -0400 (Thu, 07 Oct 2010)
New Revision: 19493
Removed:
branches/RF-7817/push-redesign/pom.xml
branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/ExpiringMap.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java
Log:
Deleted code for the first prototype of push
Deleted: branches/RF-7817/push-redesign/pom.xml
===================================================================
--- branches/RF-7817/push-redesign/pom.xml 2010-10-07 17:19:30 UTC (rev 19492)
+++ branches/RF-7817/push-redesign/pom.xml 2010-10-07 17:26:28 UTC (rev 19493)
@@ -1,58 +0,0 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.richfaces.sandbox.ui</groupId>
- <artifactId>push-redesign</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>push-redesign</name>
- <url>http://maven.apache.org</url>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>3.0-alpha-1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.7</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>2.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-api</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.atmosphere</groupId>
- <artifactId>atmosphere-runtime</artifactId>
- <version>0.6.1</version>
- </dependency>
- </dependencies>
-</project>
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces;
-
-/**
- * @author Nick Belaevski
- *
- */
-//TODO - do we need this?
-public enum DeliveryMode {
-
- nonPersistent, persistent
-}
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java 2010-10-07
17:19:30 UTC (rev 19492)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class Message {
-
- private TopicKey topicKey;
-
- private Map<String, Object> attributes = null;
-
- private Object data;
-
- public Message(TopicKey topicKey) {
- super();
- this.topicKey = topicKey;
- }
-
- public Object getData() {
- return data;
- }
-
- public void setData(Object data) {
- this.data = data;
- }
-
- public void addAttribute(String key, Object value) {
- if (attributes == null) {
- attributes = new HashMap<String, Object>();
- }
-
- attributes.put(key, value);
- }
-
- public void removeAttribute(String key) {
- if (attributes != null) {
- attributes.remove(key);
- }
- }
-
- public Map<String, Object> getAttributes() {
- if (attributes == null) {
- attributes = new HashMap<String, Object>();
- }
-
- return attributes;
- }
-
- public Object getAttribute(String key) {
- if (attributes != null) {
- return attributes.get(key);
- }
-
- return null;
- }
-
- public boolean hasAttributes() {
- return attributes != null && !attributes.isEmpty();
- }
-
- public TopicKey getTopicKey() {
- return topicKey;
- }
-}
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface MessageFilter {
-
- public boolean accept(Message message);
-
-}
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class SubscriberKey {
-
- private String uuid;
-
- /**
- * @param uuid
- */
- public SubscriberKey(String uuid) {
- super();
-
- if (uuid == null) {
- throw new NullPointerException();
- }
-
- this.uuid = uuid;
- }
-
- /**
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- SubscriberKey other = (SubscriberKey) obj;
- if (uuid == null) {
- if (other.uuid != null) {
- return false;
- }
- } else if (!uuid.equals(other.uuid)) {
- return false;
- }
- return true;
- }
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces;
-
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface SubscribersActivityListener {
-
- public void onRequestStarted(SubscriberKey subscriberKey);
-
- public void onRequestFinished(SubscriberKey subscriberKey);
-
-}
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java 2010-10-07
17:19:30 UTC (rev 19492)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class TopicKey {
-
- private String topicName;
-
- public TopicKey(String topicName) {
- super();
-
- if (topicName == null) {
- throw new NullPointerException();
- }
-
- this.topicName = topicName;
- }
-
- /**
- * @return the topicName
- */
- public String getTopicName() {
- return topicName;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((topicName == null) ? 0 : topicName.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TopicKey other = (TopicKey) obj;
- if (topicName == null) {
- if (other.topicName != null) {
- return false;
- }
- } else if (!topicName.equals(other.topicName)) {
- return false;
- }
- return true;
- }
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import org.richfaces.TopicKey;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface MessagePublisher {
-
- public void publish(TopicKey topicKey, String messageData);
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import org.richfaces.Message;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface MessageSerializer {
-
- public String serialize(Message message);
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import org.richfaces.Message;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface MessageTransformer {
-
- public Message transform(Message o);
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application;
-
-
-
-/**
- * @author Nick Belaevski
- *
- */
-public abstract class PushHandler<T> {
-
- public abstract void connect(T request);
-
- public abstract void disconnect(T request);
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import org.richfaces.Message;
-import org.richfaces.TopicKey;
-
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface PushPublisherContext {
-
- public static final String PUBLISHER_ATTRIBUTE_NAME =
"__org_richfaces_PushPublisherContext";
-
- public static final String PUBLISHER_EL_EXPRESSION = "#{" +
PUBLISHER_ATTRIBUTE_NAME + "}";
-
- //TODO - return Future?
- //TODO - use topic key?
- public void publish(TopicKey topic, Object message);
-
- //TODO - return Future?
- //TODO - use topic key?
- //TODO - priority?
- public void publish(Message message);
-
- public abstract void removeMessageTransformer(MessageTransformer transformer);
-
- public abstract void addMessageTransformer(MessageTransformer transformer);
-
- public abstract MessageSerializer getMessageSerializer();
-
- public abstract void setMessageSerializer(MessageSerializer serializer);
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/ExpiringMap.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/ExpiringMap.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/ExpiringMap.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,275 +0,0 @@
-package org.richfaces.application.impl;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.DelayQueue;
-import java.util.concurrent.Delayed;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Created by IntelliJ IDEA.
- * User: nick
- * Date: 16.09.2010
- * Time: 12:17:11
- * To change this template use File | Settings | File Templates.
- */
-public class ExpiringMap<K, V> implements Map<K, V> {
-
- public interface Entry<V> {
-
- public Object getKey();
-
- public V getValue();
-
- public void acquire();
-
- public void release();
- }
-
- private final class EntryImpl implements Entry<V> {
-
- private final AtomicInteger usageCounter = new AtomicInteger();
-
- private final K key;
-
- private volatile V value;
-
- public EntryImpl(K key) {
- super();
- this.key = key;
- }
-
- public V getValue() {
- return value;
- }
-
- public void setValue(V value) {
- if (usageCounter.get() == 0) {
- addToExpiryQueue(key, this);
- }
- this.value = value;
- }
-
- public void acquire() {
- if (usageCounter.getAndIncrement() == 0) {
- removeFromExpiryQueue(key);
- }
- }
-
- public void release() {
- if (usageCounter.decrementAndGet() == 0) {
- addToExpiryQueue(key, this);
- }
- }
-
- public K getKey() {
- return key;
- }
- }
-
- private final class DelayedQueueEntry implements Delayed {
-
- private final long expirationTime;
-
- private final Object entryKey;
-
- private final Object entryValue;
-
- public DelayedQueueEntry(Object entryKey) {
- this(entryKey, null);
- }
-
- public DelayedQueueEntry(Object entryKey, Object entryValue) {
- this(entryKey, entryValue, -1);
- }
-
- public DelayedQueueEntry(Object entryKey, Object entryValue, long expirationTime)
{
- super();
- this.entryKey = entryKey;
- this.entryValue = entryValue;
- this.expirationTime = expirationTime;
- }
-
- public long getDelay(TimeUnit unit) {
- return unit.convert(System.currentTimeMillis() - expirationTime,
TimeUnit.MILLISECONDS);
- }
-
- public int compareTo(Delayed o) {
- return
Long.valueOf(expirationTime).compareTo(o.getDelay(TimeUnit.MILLISECONDS));
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((entryKey == null) ? 0 : entryKey.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- @SuppressWarnings("unchecked") DelayedQueueEntry other =
(DelayedQueueEntry) obj;
- if (entryKey == null) {
- if (other.entryKey != null) {
- return false;
- }
- } else if (!entryKey.equals(other.entryKey)) {
- return false;
- }
- return true;
- }
-
- public Object getEntryKey() {
- return entryKey;
- }
-
- public Object getEntryValue() {
- return entryValue;
- }
- }
-
- private ConcurrentMap<K, EntryImpl> backingMap;
-
- private long defaultTTL;
-
- private Queue<DelayedQueueEntry> expiryQueue = new
DelayQueue<DelayedQueueEntry>();
-
- private ScheduledExecutorService expiryQueuePurgeExecutorService;
-
- public ExpiringMap(long defaultTTL, ScheduledExecutorService
expiryQueuePurgeExecutorService) {
- this.defaultTTL = defaultTTL;
- this.backingMap = new ConcurrentHashMap<K, EntryImpl>();
-
- this.expiryQueuePurgeExecutorService = expiryQueuePurgeExecutorService;
- startPurge();
- }
-
- private void startPurge() {
- expiryQueuePurgeExecutorService.scheduleAtFixedRate(new Runnable() {
-
- public void run() {
- DelayedQueueEntry entry;
-
- while (true) {
- entry = expiryQueue.poll();
-
- if (entry == null) {
- break;
- }
-
- backingMap.remove(entry.getEntryKey(), entry.getEntryValue());
- }
- }
- }, 0, 5, TimeUnit.SECONDS);
- }
-
- protected void addToExpiryQueue(Object key, Object value) {
- expiryQueue.add(new DelayedQueueEntry(key, value,
getExpirationTimeForCurrentTime()));
- }
-
- protected void removeFromExpiryQueue(K key) {
- expiryQueue.remove(new DelayedQueueEntry(key));
- }
-
- public void clear() {
- backingMap.clear();
- expiryQueue.clear();
- }
-
- public boolean containsKey(Object key) {
- return backingMap.containsKey(key);
- }
-
- public boolean containsValue(Object value) {
- return backingMap.containsValue(value);
- }
-
- private long getExpirationTimeForCurrentTime() {
- return System.currentTimeMillis() + defaultTTL;
- }
-
- private EntryImpl getOrCreateEntry(K key) {
- EntryImpl entry = backingMap.get(key);
-
- if (entry == null) {
- EntryImpl existingEntry = backingMap.putIfAbsent(key, new EntryImpl(key));
- if (existingEntry != null) {
- entry = existingEntry;
- }
- }
-
- return entry;
- }
-
- public V get(Object key) {
- Entry<V> entry = backingMap.get(key);
-
- if (entry != null) {
- return entry.getValue();
- }
-
- return null;
- }
-
- public V put(K key, V value) {
- EntryImpl entry = getOrCreateEntry(key);
- V oldValue = entry.getValue();
- entry.setValue(value);
- return oldValue;
- }
-
- public Entry<V> getEntry(Object key) {
- return backingMap.get(key);
- }
-
- public boolean isEmpty() {
- return backingMap.isEmpty();
- }
-
- public V remove(Object key) {
- expiryQueue.remove(new DelayedQueueEntry(key));
- Entry<V> removed = backingMap.remove(key);
- if (removed != null) {
- return removed.getValue();
- }
- return null;
- }
-
- public void putAll(Map<? extends K, ? extends V> m) {
- for (java.util.Map.Entry<? extends K, ? extends V> entry: m.entrySet()) {
- put(entry.getKey(), entry.getValue());
- }
- }
-
- public Set<java.util.Map.Entry<K, V>> entrySet() {
- throw new UnsupportedOperationException();
- }
-
- public Set<K> keySet() {
- throw new UnsupportedOperationException();
- }
-
- public Collection<V> values() {
- throw new UnsupportedOperationException();
- }
-
- public int size() {
- return backingMap.size();
- }
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,100 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application.impl;
-
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.richfaces.Message;
-import org.richfaces.TopicKey;
-import org.richfaces.application.MessagePublisher;
-import org.richfaces.application.MessageSerializer;
-import org.richfaces.application.MessageTransformer;
-import org.richfaces.application.PushPublisherContext;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class PushPublisherContextImpl implements PushPublisherContext {
-
- private final MessagePublisher publisher;
-
- private volatile MessageSerializer serializer = new DefaultMessageSerializer();
-
- private List<MessageTransformer> transformers = new
CopyOnWriteArrayList<MessageTransformer>();
-
- public PushPublisherContextImpl(MessagePublisher publisher) {
- super();
- this.publisher = publisher;
- }
-
- public void setMessageSerializer(MessageSerializer serializer) {
- this.serializer = serializer;
- }
-
- public MessageSerializer getMessageSerializer() {
- return serializer;
- }
-
- public void addMessageTransformer(MessageTransformer transformer) {
- if (!transformers.contains(transformer)) {
- transformers.add(transformer);
- }
- }
-
- public void removeMessageTransformer(MessageTransformer transformer) {
- transformers.remove(transformer);
- }
-
- protected Message getTransformedMessage(Message message) {
- Message result = message;
-
- for (MessageTransformer transformer : transformers) {
- result = transformer.transform(result);
- if (result == null) {
- break;
- }
- }
-
- return result;
- }
-
- protected void doPublish(Message message) {
- publisher.publish(message.getTopicKey(), serializer.serialize(message));
- }
-
- public void publish(TopicKey topic, Object message) {
- Message messageObject = new Message(topic);
- messageObject.setData(message);
- publish(messageObject);
- }
-
- public void publish(Message message) {
- Message transformedMessage = getTransformedMessage(message);
-
- if (transformedMessage != null) {
- doPublish(transformedMessage);
- }
- }
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,153 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application.impl;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import org.richfaces.MessageFilter;
-import org.richfaces.SubscriberKey;
-import org.richfaces.SubscribersActivityListener;
-import org.richfaces.TopicKey;
-import org.richfaces.component.PushSubscriberContext;
-import org.richfaces.component.Subscription;
-import org.richfaces.component.SubscriptionImpl;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.LinkedHashMultimap;
-import com.google.common.collect.MapMaker;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Multimaps;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class PushSubscriberContextImpl implements PushSubscriberContext,
SubscribersActivityListener {
-
- /**
- *
- */
- private static final int EXPIRATION_INTERVAL = 5 * 60 * 1000;
-
- private static final Subscription[] EMPTY_SUBSCRPTION_ARRAY = new Subscription[0];
-
- private Multimap<SubscriberKey, Subscription> subscriptionsMap =
Multimaps.synchronizedSetMultimap(
- LinkedHashMultimap.<SubscriberKey, Subscription>create());
-
- private Map<SubscriberKey, SubscriberActivityData> subscribersActivityMap = new
MapMaker().makeComputingMap(new Function<SubscriberKey, SubscriberActivityData>() {
-
- public SubscriberActivityData apply(SubscriberKey from) {
- return new SubscriberActivityData();
- }
-
- });
-
- private ScheduledExecutorService activityExpirationService;
-
- public PushSubscriberContextImpl() {
- activityExpirationService = new ScheduledThreadPoolExecutor(1);
- activityExpirationService.scheduleAtFixedRate(new Runnable() {
-
- public void run() {
-
- Iterator<Entry<SubscriberKey, SubscriberActivityData>>
entries = subscribersActivityMap.entrySet().iterator();
- while (entries.hasNext()) {
- Entry<SubscriberKey, SubscriberActivityData> entry =
entries.next();
-
- long lastAccessTime = entry.getValue().getLastAccessTime();
-
- if (lastAccessTime < 0) {
- continue;
- }
-
- if (System.currentTimeMillis() - lastAccessTime >
EXPIRATION_INTERVAL) {
- unsubscribe(entry.getKey());
- }
- }
- }
- }, 0, 1, TimeUnit.SECONDS);
- }
-
- protected void onSubscriptionAdded(SubscriberKey subscriberKey, Subscription
subscription) {
- //force activity data creation
- subscribersActivityMap.get(subscriberKey);
- }
-
- protected void onSubscriptionRemoved(SubscriberKey subscriberKey) {
- subscribersActivityMap.remove(subscriberKey);
- }
-
- public void subscribe(SubscriberKey subscriberKey, TopicKey topic) {
- Subscription subscription = new SubscriptionImpl(topic, null, false);
- subscriptionsMap.put(subscriberKey, subscription);
- onSubscriptionAdded(subscriberKey, subscription);
- }
-
- public void subscribe(SubscriberKey subscriberKey, TopicKey topic, MessageFilter
filter) {
- SubscriptionImpl subscription = new SubscriptionImpl(topic, filter, false);
- subscriptionsMap.put(subscriberKey, subscription);
- onSubscriptionAdded(subscriberKey, subscription);
- }
-
- public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic) {
- Subscription subscription = new SubscriptionImpl(topic, null, true);
- subscriptionsMap.put(subscriberKey, subscription);
- onSubscriptionAdded(subscriberKey, subscription);
- }
-
- public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic,
MessageFilter filter) {
- Subscription subscription = new SubscriptionImpl(topic, filter, true);
- subscriptionsMap.put(subscriberKey, subscription);
- onSubscriptionAdded(subscriberKey, subscription);
- }
-
- public Subscription[] getSubscriptions(SubscriberKey subscriberKey) {
- Collection<Subscription> collection = subscriptionsMap.get(subscriberKey);
- if (collection == null) {
- return null;
- }
-
- return collection.toArray(EMPTY_SUBSCRPTION_ARRAY);
- }
-
- public void unsubscribe(SubscriberKey subscriberKey) {
- if (!Iterables.isEmpty(subscriptionsMap.removeAll(subscriberKey))) {
- onSubscriptionRemoved(subscriberKey);
- }
- subscribersActivityMap.remove(subscriberKey);
- }
-
- public void onRequestStarted(SubscriberKey subscriberKey) {
- subscribersActivityMap.get(subscriberKey).onRequestStarted();
- }
-
- public void onRequestFinished(SubscriberKey subscriberKey) {
- subscribersActivityMap.get(subscriberKey).onRequestFinished();
- }
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.application.impl;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * @author Nick Belaevski
- *
- */
-final class SubscriberActivityData {
-
- private AtomicInteger requestsCount = new AtomicInteger();
-
- private volatile long lastAccessTime = System.currentTimeMillis();
-
- public void onRequestStarted() {
- requestsCount.incrementAndGet();
-
- lastAccessTime = -1;
- }
-
- public void onRequestFinished() {
- if (requestsCount.decrementAndGet() == 0) {
- lastAccessTime = System.currentTimeMillis();
- }
- }
-
- public long getLastAccessTime() {
- return lastAccessTime;
- }
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.component;
-
-import org.richfaces.MessageFilter;
-import org.richfaces.SubscriberKey;
-import org.richfaces.TopicKey;
-
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface PushSubscriberContext {
-
- public static final String SUBSCRIBER_ATTRIBUTE_NAME =
"__org_richfaces_PushSubscriberContext";
-
- public void subscribe(SubscriberKey subscriberKey, TopicKey topic);
-
- public void subscribe(SubscriberKey subscriberKey, TopicKey topic, MessageFilter
filter);
-
- public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic);
-
- public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic,
MessageFilter filter);
-
- public void unsubscribe(SubscriberKey subscriberKey);
-
- public Subscription[] getSubscriptions(SubscriberKey subscriberKey);
-
- public abstract void onRequestFinished(SubscriberKey subscriberKey);
-
- public abstract void onRequestStarted(SubscriberKey subscriberKey);
-
-}
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.component;
-
-import org.richfaces.MessageFilter;
-import org.richfaces.TopicKey;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface Subscription {
-
- public abstract TopicKey getTopicKey();
-
- public abstract MessageFilter getMessageFilter();
-
- public abstract boolean isDurable();
-
-}
\ No newline at end of file
Deleted:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java
===================================================================
---
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java 2010-10-07
17:19:30 UTC (rev 19492)
+++
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java 2010-10-07
17:26:28 UTC (rev 19493)
@@ -1,92 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.component;
-
-import org.richfaces.MessageFilter;
-import org.richfaces.TopicKey;
-
-public final class SubscriptionImpl implements Subscription {
-
- private final TopicKey topicKey;
-
- private final MessageFilter messageFilter;
-
- private final boolean durability;
-
- public SubscriptionImpl(TopicKey topicKey, MessageFilter messageFilter, boolean
durability) {
- super();
- this.topicKey = topicKey;
- this.messageFilter = messageFilter;
- this.durability = durability;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((topicKey == null) ? 0 : topicKey.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- SubscriptionImpl other = (SubscriptionImpl) obj;
- if (topicKey == null) {
- if (other.topicKey != null) {
- return false;
- }
- } else if (!topicKey.equals(other.topicKey)) {
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.component.Subscription#getTopicKey()
- */
- public TopicKey getTopicKey() {
- return topicKey;
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.component.Subscription#getMessageFilter()
- */
- public MessageFilter getMessageFilter() {
- return messageFilter;
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.component.Subscription#isDurable()
- */
- public boolean isDurable() {
- return durability;
- }
-}
\ No newline at end of file