ws-pubscribe-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lisc...@apache.org
Subject svn commit: r158387 [1/3] - in incubator/hermes/trunk/src/examples: ./ broker/ broker/WEB-INF/ pubsubclient/ pubsubclient/WEB-INF/
Date Mon, 21 Mar 2005 00:41:16 GMT
Author: lischke
Date: Sun Mar 20 16:41:11 2005
New Revision: 158387

URL: http://svn.apache.org/viewcvs?view=rev&rev=158387
Log:
examples for pubsub stuff,

including one Broker and a subscriber/publiser Client with GUI based on TCPmon

Added:
    incubator/hermes/trunk/src/examples/
    incubator/hermes/trunk/src/examples/broker/
    incubator/hermes/trunk/src/examples/broker/Broker.java
    incubator/hermes/trunk/src/examples/broker/BrokerHome.java
    incubator/hermes/trunk/src/examples/broker/BrokerResource.java
    incubator/hermes/trunk/src/examples/broker/JettyAxisServer.java
    incubator/hermes/trunk/src/examples/broker/WEB-INF/
    incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config.wsdd
    incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config_wse.wsdd
    incubator/hermes/trunk/src/examples/broker/build.properties
    incubator/hermes/trunk/src/examples/broker/build.xml
    incubator/hermes/trunk/src/examples/broker/jndi-config.xml
    incubator/hermes/trunk/src/examples/broker/jndi-config_wse.xml
    incubator/hermes/trunk/src/examples/broker/log4j.properties
    incubator/hermes/trunk/src/examples/broker/topicspace.xml
    incubator/hermes/trunk/src/examples/pubsubclient/
    incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java
    incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java
    incubator/hermes/trunk/src/examples/pubsubclient/JettyAxisServer.java
    incubator/hermes/trunk/src/examples/pubsubclient/NotListModel.java
    incubator/hermes/trunk/src/examples/pubsubclient/PubSubClient.java
    incubator/hermes/trunk/src/examples/pubsubclient/PubSubWSmanager.java
    incubator/hermes/trunk/src/examples/pubsubclient/PublisherPanel.java
    incubator/hermes/trunk/src/examples/pubsubclient/SubListModel.java
    incubator/hermes/trunk/src/examples/pubsubclient/SubscribePanel.java
    incubator/hermes/trunk/src/examples/pubsubclient/TopicSpaceTree.java
    incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/
    incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config.wsdd
    incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config_wse.wsdd
    incubator/hermes/trunk/src/examples/pubsubclient/build.properties
    incubator/hermes/trunk/src/examples/pubsubclient/build.xml
    incubator/hermes/trunk/src/examples/pubsubclient/client-config.wsdd
    incubator/hermes/trunk/src/examples/pubsubclient/jndi-config_wse.xml
    incubator/hermes/trunk/src/examples/pubsubclient/jndi-config_wsn.xml
    incubator/hermes/trunk/src/examples/pubsubclient/topicspace.xml

Added: incubator/hermes/trunk/src/examples/broker/Broker.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/Broker.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/Broker.java (added)
+++ incubator/hermes/trunk/src/examples/broker/Broker.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,122 @@
+/*
+ * Broker.java
+ *
+ * Created on 18. Februar 2005, 16:09
+ */
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+/**
+ *
+ * @author  Administrator
+ */
+public class Broker extends javax.swing.JFrame {
+    private static final Log LOG = LogFactory.getLog( Broker.class.getName() );
+    
+    /** Creates new form Broker */
+    public Broker(String hermes_home) {
+        initComponents();
+        
+        LOG.info("HERMES_HOME: "+hermes_home);
+        if(hermes_home==null){
+            System.out.println("HERMES_HOME not set");
+        }else{
+            try{
+                JettyAxisServer jas = new JettyAxisServer();
+                jas.setPort(8080);
+                jas.setResourceBase(hermes_home);
+                jas.start();
+                LOG.info("JAS started"+jas.log.toString());
+            }catch(Exception e){
+                e.printStackTrace();
+            }
+        }
+    }
+    
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    private void initComponents() {//GEN-BEGIN:initComponents
+        menuBar = new javax.swing.JMenuBar();
+        fileMenu = new javax.swing.JMenu();
+        openMenuItem = new javax.swing.JMenuItem();
+        saveMenuItem = new javax.swing.JMenuItem();
+        saveAsMenuItem = new javax.swing.JMenuItem();
+        exitMenuItem = new javax.swing.JMenuItem();
+        editMenu = new javax.swing.JMenu();
+        cutMenuItem = new javax.swing.JMenuItem();
+        copyMenuItem = new javax.swing.JMenuItem();
+        pasteMenuItem = new javax.swing.JMenuItem();
+        deleteMenuItem = new javax.swing.JMenuItem();
+        helpMenu = new javax.swing.JMenu();
+        contentsMenuItem = new javax.swing.JMenuItem();
+        aboutMenuItem = new javax.swing.JMenuItem();
+        
+        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+        fileMenu.setText("File");
+        openMenuItem.setText("Open");
+        fileMenu.add(openMenuItem);
+        saveMenuItem.setText("Save");
+        fileMenu.add(saveMenuItem);
+        saveAsMenuItem.setText("Save As ...");
+        fileMenu.add(saveAsMenuItem);
+        exitMenuItem.setText("Exit");
+        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                exitMenuItemActionPerformed(evt);
+            }
+        });
+        
+        fileMenu.add(exitMenuItem);
+        menuBar.add(fileMenu);
+        editMenu.setText("Edit");
+        cutMenuItem.setText("Cut");
+        editMenu.add(cutMenuItem);
+        copyMenuItem.setText("Copy");
+        editMenu.add(copyMenuItem);
+        pasteMenuItem.setText("Paste");
+        editMenu.add(pasteMenuItem);
+        deleteMenuItem.setText("Delete");
+        editMenu.add(deleteMenuItem);
+        menuBar.add(editMenu);
+        helpMenu.setText("Help");
+        contentsMenuItem.setText("Contents");
+        helpMenu.add(contentsMenuItem);
+        aboutMenuItem.setText("About");
+        helpMenu.add(aboutMenuItem);
+        menuBar.add(helpMenu);
+        setJMenuBar(menuBar);
+        
+        pack();
+    }//GEN-END:initComponents
+    
+    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
+        System.exit(0);
+    }//GEN-LAST:event_exitMenuItemActionPerformed
+    
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String args[]) {
+        new Broker(args[0]).show();
+    }
+    
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JMenuItem cutMenuItem;
+    private javax.swing.JMenuItem pasteMenuItem;
+    private javax.swing.JMenuItem aboutMenuItem;
+    private javax.swing.JMenuItem deleteMenuItem;
+    private javax.swing.JMenuItem saveAsMenuItem;
+    private javax.swing.JMenuItem saveMenuItem;
+    private javax.swing.JMenu helpMenu;
+    private javax.swing.JMenuBar menuBar;
+    private javax.swing.JMenuItem contentsMenuItem;
+    private javax.swing.JMenu editMenu;
+    private javax.swing.JMenuItem exitMenuItem;
+    private javax.swing.JMenuItem copyMenuItem;
+    private javax.swing.JMenu fileMenu;
+    private javax.swing.JMenuItem openMenuItem;
+    // End of variables declaration//GEN-END:variables
+    
+}

Added: incubator/hermes/trunk/src/examples/broker/BrokerHome.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/BrokerHome.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/BrokerHome.java (added)
+++ incubator/hermes/trunk/src/examples/broker/BrokerHome.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,18 @@
+
+/**
+ *
+ * @author  Stefan Lischke
+ */
+import org.apache.ws.resource.impl.AbstractResourceHome;
+
+public class BrokerHome extends AbstractResourceHome{
+    
+    /** Creates a new instance of NotificationProducerHome */
+    public BrokerHome() {
+    }
+    
+    public org.apache.ws.resource.Resource getInstance(org.apache.ws.resource.ResourceContext resourceContext) throws org.apache.ws.resource.ResourceException, org.apache.ws.resource.ResourceContextException, org.apache.ws.resource.ResourceUnknownException {
+        return BrokerResource.getInstance();
+    }
+    
+}

Added: incubator/hermes/trunk/src/examples/broker/BrokerResource.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/BrokerResource.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/BrokerResource.java (added)
+++ incubator/hermes/trunk/src/examples/broker/BrokerResource.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,46 @@
+/**
+ *
+ * @author  Stefan Lischke
+ */
+import org.apache.ws.notification.topics.*;
+import org.apache.ws.notification.topics.impl.*;
+
+public class BrokerResource implements org.apache.ws.notification.base.NotificationProducerResource{    
+    private static BrokerResource s_ourInstance= new BrokerResource();
+    private TopicSpaceSet m_topicSpaceSet;
+    //private TopicSpace m_topicSpace;
+    
+    /** Creates a new instance of BrokerResource */
+    public BrokerResource() {
+        m_topicSpaceSet = new TopicSpaceSetImpl();
+        //m_topicSpace = new TopicSpaceImpl("http://www.borker.de");
+        //m_topicSpace.addTopic(new TopicImpl("root"));
+        m_topicSpaceSet.addTopicSpace(org.apache.ws.notification.topics.util.TopicSpaceParser.parse(Thread.currentThread().getContextClassLoader().getResourceAsStream("topicspace.xml")));   
+
+    }
+    
+    public static BrokerResource getInstance(){
+        return s_ourInstance;
+    }
+    
+    public TopicSpaceSet getTopicSpaceSet() {
+        return m_topicSpaceSet;
+    }
+    
+    public void destroy() {
+    }
+    
+    public Object getID() {
+        return "1";
+    }
+    
+    public void init() {
+    }
+    
+    public void setID(Object id) {
+    }
+    
+    public void addTerminationListener(org.apache.ws.resource.lifetime.ResourceTerminationListener termListener){
+        
+    }
+}

Added: incubator/hermes/trunk/src/examples/broker/JettyAxisServer.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/JettyAxisServer.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/JettyAxisServer.java (added)
+++ incubator/hermes/trunk/src/examples/broker/JettyAxisServer.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.
+ */
+
+import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.utils.Messages;
+import org.apache.axis.utils.Options;
+import org.apache.commons.logging.Log;
+import org.mortbay.http.HttpContext;
+import org.mortbay.http.HttpServer;
+import org.mortbay.http.SocketListener;
+import org.mortbay.http.handler.ResourceHandler;
+import org.mortbay.jetty.servlet.ServletHandler;
+
+import java.net.MalformedURLException;
+
+public class JettyAxisServer {
+    public static Log log =
+            LogFactory.getLog(JettyAxisServer.class.getName());
+
+    /**
+     * Jetty HTTP Server * 
+     */
+    HttpServer server = new HttpServer();
+
+    /**
+     * Socket Listener *
+     */
+    SocketListener listener = new SocketListener();
+
+    /**
+     * HTTP Context
+     */
+    HttpContext context = new HttpContext();
+
+    public JettyAxisServer() {
+        // Create a context 
+        context.setContextPath("/axis/*");
+        server.addContext(context);
+      
+        // Create a servlet container
+        ServletHandler servlets = new ServletHandler();
+        context.addHandler(servlets);
+
+        // Map a servlet onto the container
+        servlets.addServlet("AdminServlet", "/servlet/AdminServlet",
+                "org.apache.axis.transport.http.AdminServlet");
+        servlets.addServlet("AxisServlet", "/servlet/AxisServlet",
+                "org.apache.ws.resource.handler.axis.WsrfAxisServlet");
+        servlets.addServlet("AxisServlet", "/services/*",
+                "org.apache.ws.resource.handler.axis.WsrfAxisServlet");
+        //servlets.addServlet("AxisServlet", "*.jws",
+        //        "org.apache.axis.transport.http.AxisServlet");
+        context.addHandler(new ResourceHandler());
+    }
+
+    /**
+     * Set the port
+     *
+     * @param port
+     */
+    public void setPort(int port) {
+        listener.setPort(port);
+        server.addListener(listener);
+    }
+
+    /**
+     * Set the resource base
+     *
+     * @param dir
+     */
+    public void setResourceBase(String dir) {
+        context.setResourceBase(dir);
+    }
+
+    /**
+     * Start the server
+     *
+     * @throws Exception
+     */
+    public void start() throws Exception {
+        server.start();
+        log.info(
+                Messages.getMessage("start00", "JettyAxisServer",
+                        new Integer(listener.getServerSocket().getLocalPort()).toString()));
+    }
+
+    /*
+    public static void main(String[] args) {
+        Options opts = null;
+        try {
+            opts = new Options(args);
+        } catch (MalformedURLException e) {
+            log.error(Messages.getMessage("malformedURLException00"), e);
+            return;
+        }
+        JettyAxisServer server = new JettyAxisServer();
+        server.setPort(opts.getPort());
+        String dir = opts.isValueSet('d');
+        if (dir == null) {
+            // Serve static content from the context
+            dir = System.getProperty("jetty.home", ".") + "/webapps/axis/";
+        }
+        server.setResourceBase(dir);
+        
+        // Start the http server
+        try {
+            server.start();
+        } catch (Exception e) {
+            log.error(Messages.getMessage("exception00"), e);
+        }
+    }
+    */
+}
\ No newline at end of file

Added: incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config.wsdd
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config.wsdd?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config.wsdd (added)
+++ incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config.wsdd Sun Mar 20 16:41:11 2005
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+ <globalConfiguration>
+  <parameter name="adminPassword" value="admin"/>
+  <parameter name="disablePrettyXML" value="true"/>
+  <parameter name="sendXsiTypes" value="true"/>
+  <parameter name="sendMultiRefs" value="true"/>
+  <parameter name="sendXMLDeclaration" value="true"/>
+  <requestFlow>
+   <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+  </requestFlow>
+  <responseFlow>
+   <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+  </responseFlow>
+ </globalConfiguration>
+ <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/>
+ <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
+ <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
+
+ <service name="AdminService" provider="java:MSG">
+  <parameter name="allowedMethods" value="AdminService"/>
+  <parameter name="enableRemoteAdmin" value="false"/>
+  <parameter name="className" value="org.apache.axis.utils.Admin"/>
+  <namespace>http://xml.apache.org/axis/wsdd/</namespace>
+  <namespace>http://xml.apache.org/axis/wsdd/</namespace>
+ </service>
+
+ <service name="Version" provider="java:RPC">
+  <parameter name="allowedMethods" value="getVersion"/>
+  <parameter name="className" value="org.apache.axis.Version"/>
+ </service>
+
+ <service name="NotificationProducer" provider="java:WSRF" style="document" use="literal">
+ </service>
+
+ <service name="SubscriptionManager" provider="java:WSRF" style="document" use="literal">
+</service>
+
+ <service name="NotificationPort" provider="java:RPC" style="document" use="literal">
+  <parameter name="className" value="org.apache.ws.notification.base.impl.BrokerService"/>
+  <parameter name="allowedMethods" value="notify"/>
+ </service>
+
+ <transport name="http">
+  <requestFlow>
+   <handler type="URLMapper"/>
+   <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
+  </requestFlow>
+  <parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/>
+  <parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
+  <parameter name="qs.list" value="org.apache.axis.transport.http.QSListHandler"/>
+  <parameter name="qs.method" value="org.apache.axis.transport.http.QSMethodHandler"/>
+  <parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/>
+  <parameter name="qs.wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
+ </transport>
+ <transport name="local">
+  <responseFlow>
+   <handler type="LocalResponder"/>
+  </responseFlow>
+ </transport>
+</deployment>

Added: incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config_wse.wsdd
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config_wse.wsdd?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config_wse.wsdd (added)
+++ incubator/hermes/trunk/src/examples/broker/WEB-INF/server-config_wse.wsdd Sun Mar 20 16:41:11 2005
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+ <globalConfiguration>
+  <parameter name="adminPassword" value="admin"/>
+  <parameter name="disablePrettyXML" value="true"/>
+  <parameter name="sendXsiTypes" value="true"/>
+  <parameter name="sendMultiRefs" value="true"/>
+  <parameter name="sendXMLDeclaration" value="true"/>
+  <requestFlow>
+   <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+  </requestFlow>
+  <responseFlow>
+   <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+  </responseFlow>
+ </globalConfiguration>
+ <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/>
+ <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
+ <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
+
+ <service name="AdminService" provider="java:MSG">
+  <parameter name="allowedMethods" value="AdminService"/>
+  <parameter name="enableRemoteAdmin" value="false"/>
+  <parameter name="className" value="org.apache.axis.utils.Admin"/>
+  <namespace>http://xml.apache.org/axis/wsdd/</namespace>
+  <namespace>http://xml.apache.org/axis/wsdd/</namespace>
+ </service>
+
+ <service name="Version" provider="java:RPC">
+  <parameter name="allowedMethods" value="getVersion"/>
+  <parameter name="className" value="org.apache.axis.Version"/>
+ </service>
+
+ <service name="NotificationProducer" provider="java:WSRF" style="document" use="literal">
+ </service>
+
+ <service name="SubscriptionManager" provider="java:WSRF" style="document" use="literal">
+</service>
+
+ <service name="NotificationPort" provider="java:MSG" style="message" use="literal">
+  <parameter name="className" value="org.apache.ws.eventing.services.BrokerService"/>
+  <parameter name="allowedMethods" value="filter"/>
+ </service>
+
+ <transport name="http">
+  <requestFlow>
+   <handler type="URLMapper"/>
+   <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
+  </requestFlow>
+  <parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/>
+  <parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
+  <parameter name="qs.list" value="org.apache.axis.transport.http.QSListHandler"/>
+  <parameter name="qs.method" value="org.apache.axis.transport.http.QSMethodHandler"/>
+  <parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/>
+  <parameter name="qs.wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
+ </transport>
+ <transport name="local">
+  <responseFlow>
+   <handler type="LocalResponder"/>
+  </responseFlow>
+ </transport>
+</deployment>

Added: incubator/hermes/trunk/src/examples/broker/build.properties
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/build.properties?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/build.properties (added)
+++ incubator/hermes/trunk/src/examples/broker/build.properties Sun Mar 20 16:41:11 2005
@@ -0,0 +1,11 @@
+base.url=http://localhost:8080/hermes/services
+
+# Uncomment and modify the below lines if you would like to deploy to a
+# hermes webapp located somewhere other than the default location of
+# ../webapps/hermes (e.g. ${env.CATALINA_HOME}/webapps/hermes)
+hermes.webapp.dir=d:/projects/hermes/trunk/target/hermes-incubating-1.0-alpha-SNAPSHOT/bin/hermes-incubating-1.0-alpha-SNAPSHOT/webapps/hermes
+
+# Uncomment and modify the below lines if you require a proxy to connect to external web sites
+#http.proxyHost=proxy.xyz.com
+#http.proxyPort=8088
+#http.nonProxyHosts=localhost 

Added: incubator/hermes/trunk/src/examples/broker/build.xml
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/build.xml?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/build.xml (added)
+++ incubator/hermes/trunk/src/examples/broker/build.xml Sun Mar 20 16:41:11 2005
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+
+<project name="broker_example" default="usage" basedir=".">
+
+   <property environment="env" />   
+   <property file="build.properties" />
+
+   <!-- workaround for those IDEs that dont set ant.home as per the ant script -->
+   <property name="ant.home" value="env.ANT_HOME"/>
+<property name="base.dir" value="${basedir}"/>    
+   <target name="init">
+     
+     <available file="../../webapps/hermes" type="dir" property="dist.hermes.webapp.dir" value="../../webapps/hermes" />         
+     <condition property="hermes.webapp.dir" value="${dist.hermes.webapp.dir}">
+        <isset property="dist.hermes.webapp.dir"/>
+     </condition>     
+          
+     <fail unless="hermes.webapp.dir" message="webapp dir ../../webapps/hermes does not exist." />    
+     <echo>Using webapp dir: ${hermes.webapp.dir}</echo>    
+
+
+    <mkdir dir="build/classes"/>
+    <copy file="jndi-config.xml" todir="build/classes/"/>
+    <copy file="log4j.properties" todir="build/classes/"/>
+     <path id="hermes.classpath.id">
+       <pathelement location="build/classes" />
+       <fileset dir="./lib" includes="*.jar" />
+       <pathelement location="${hermes.webapp.dir}/WEB-INF/classes" />
+       <fileset dir="${hermes.webapp.dir}/WEB-INF/lib" includes="*.jar" />
+       <pathelement location="${activation.jar}" />
+       <pathelement location="${mail.jar}" />
+     </path>
+     <property name="hermes.classpath" refid="hermes.classpath.id" />
+         
+      </target>
+  
+   <target name="build" depends="init">
+    <javac srcdir="." destdir="build/classes" classpathref="hermes.classpath.id">
+      <include name="*.java"/>
+    </javac>
+  </target>
+  
+  <target name="execute" depends="build">
+       <java classname="Broker" classpathref="hermes.classpath.id" fork="true">
+        <arg value="${base.dir}"/>
+              </java>
+  </target>
+         
+   <target name="usage">      
+      <java classname="org.apache.tools.ant.Main">
+         <arg value="-buildfile" />
+         <arg value="${ant.file}" />
+         <arg value="-projecthelp" />
+      </java>
+   </target>   
+
+</project>

Added: incubator/hermes/trunk/src/examples/broker/jndi-config.xml
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/jndi-config.xml?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/jndi-config.xml (added)
+++ incubator/hermes/trunk/src/examples/broker/jndi-config.xml Sun Mar 20 16:41:11 2005
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+   <global>
+      
+      <resource name="DefaultParameters" type="org.apache.ws.util.jndi.DefaultParameters">
+         <resourceParams>
+            <parameter>
+               <name>factory</name>
+               <value>org.apache.ws.util.jndi.BeanFactory</value>
+            </parameter>           
+            <parameter>
+               <name>resourceKeyClassName</name>
+               <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
+            </parameter>
+         </resourceParams>
+      </resource>
+      
+      <resource name="timer/ContainerTimer" type="org.apache.ws.util.timer.TimerManagerImpl">
+         <resourceParams>
+            <parameter>
+               <name>factory</name>
+               <value>org.apache.ws.util.jndi.BeanFactory</value>
+            </parameter>
+         </resourceParams>
+      </resource>
+      
+      <resource name="topic/eval/concret" type="org.apache.ws.notification.topics.impl.ConcreteTopicExpressionEvaluator">
+         <resourceParams>
+	     <parameter>
+		<name>factory</name>
+		<value>org.apache.ws.util.jndi.BeanFactory</value>
+	     </parameter>
+         </resourceParams>
+      </resource>
+      
+      <resource name="topic/eval/simple" type="org.apache.ws.notification.topics.impl.SimpleTopicExpressionEvaluator">
+         <resourceParams>
+	     <parameter>
+		<name>factory</name>
+		<value>org.apache.ws.util.jndi.BeanFactory</value>
+	     </parameter>
+         </resourceParams>
+      </resource>
+            
+      <resource name="topic/ContainerTopicExpressionEngine" type="org.apache.ws.notification.topics.impl.TopicExpressionEngineImpl">
+         <resourceParams>
+      	     <parameter>
+      		<name>factory</name>
+      		<value>org.apache.ws.util.jndi.BeanFactory</value>
+      	     </parameter>
+         </resourceParams>
+      </resource>          
+      
+   </global>
+
+   <service name="SubscriptionManager">
+      <resource name="home" type="org.apache.ws.notification.base.impl.SubscriptionHome">
+         <resourceParams>    
+            <parameter>
+               <name>serviceClassName</name>
+               <value>org.apache.ws.notification.base.impl.BrokerService</value>
+            </parameter>
+            <parameter>
+               <name>resourceClassName</name>
+               <value>org.apache.ws.notification.base.v1_2.impl.Subscription1_2Resource</value>
+            </parameter>
+            <parameter>
+               <name>wsdlTargetNamespace</name>
+               <value>http://ws.apache.org/notification/services/SubscriptionManager</value>
+            </parameter>            
+            <parameter>
+               <name>resourceKeyName</name>
+               <value>{http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification}Identifier</value>
+            </parameter>
+         </resourceParams>
+      </resource>
+   </service>
+   
+      <service name="NotificationProducer">
+      <resource name="home" type="BrokerHome">
+         <resourceParams>    
+            <parameter>
+               <name>serviceClassName</name>
+               <value>org.apache.ws.notification.base.impl.BrokerService</value>
+            </parameter>
+            <parameter>
+               <name>resourceClassName</name>
+               <value>BrokerResource</value>
+            </parameter>
+            <parameter>
+               <name>wsdlTargetNamespace</name>
+               <value>http://ws.apache.org/notification/services/Broker</value>
+            </parameter>            
+            <!--
+            <parameter>
+               <name>resourceKeyName</name>
+               <value>{http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification}Identifier</value>
+            </parameter>
+            -->
+         </resourceParams>
+      </resource>
+   </service>
+</jndiConfig>
+    

Added: incubator/hermes/trunk/src/examples/broker/jndi-config_wse.xml
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/jndi-config_wse.xml?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/jndi-config_wse.xml (added)
+++ incubator/hermes/trunk/src/examples/broker/jndi-config_wse.xml Sun Mar 20 16:41:11 2005
@@ -0,0 +1,120 @@
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+   <global>
+      
+      <resource name="DefaultParameters" type="org.apache.ws.util.jndi.DefaultParameters">
+         <resourceParams>
+            <parameter>
+               <name>factory</name>
+               <value>org.apache.ws.util.jndi.BeanFactory</value>
+            </parameter>           
+            <parameter>
+               <name>resourceKeyClassName</name>
+               <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
+            </parameter>
+         </resourceParams>
+      </resource>
+      
+      <resource name="timer/ContainerTimer" type="org.apache.ws.util.timer.TimerManagerImpl">
+         <resourceParams>
+            <parameter>
+               <name>factory</name>
+               <value>org.apache.ws.util.jndi.BeanFactory</value>
+            </parameter>
+         </resourceParams>
+      </resource>
+      
+      <resource name="topic/eval/simple" type="org.apache.ws.notification.topics.impl.SimpleTopicExpressionEvaluator">
+         <resourceParams>
+	     <parameter>
+		<name>factory</name>
+		<value>org.apache.ws.util.jndi.BeanFactory</value>
+	     </parameter>
+         </resourceParams>
+      </resource>
+      
+      <resource name="topic/ContainerTopicExpressionEngine" type="org.apache.ws.notification.topics.impl.TopicExpressionEngineImpl">
+         <resourceParams>
+      	     <parameter>
+      		<name>factory</name>
+      		<value>org.apache.ws.util.jndi.BeanFactory</value>
+      	     </parameter>
+         </resourceParams>
+      </resource>          
+      
+   </global>
+
+   <service name="SubscriptionManager">
+      <resource name="home" type="org.apache.ws.eventing.SubscriptionHome">
+         <resourceParams>    
+            <parameter>
+               <name>serviceClassName</name>
+               <value>org.apache.ws.eventing.services.BrokerService</value>
+            </parameter>
+            <parameter>
+               <name>resourceClassName</name>
+               <value>org.apache.ws.eventing.Subscription</value>
+            </parameter>
+            <parameter>
+               <name>wsdlTargetNamespace</name>
+               <value>http://ws.apache.org/eventing/services/SubscriptionManager</value>
+            </parameter>            
+            <parameter>
+               <name>resourceKeyName</name>
+               <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+            </parameter>
+         </resourceParams>
+      </resource>
+   </service>
+
+   <service name="NotificationProducer">
+      <resource name="home" type="BrokerHome">
+         <resourceParams>        
+            <parameter>
+               <name>serviceClassName</name>
+               <value>org.apache.ws.eventing.services.BrokerService</value>
+            </parameter>
+            <parameter>
+               <name>resourceClassName</name>
+               <value>BrokerResource</value>
+            </parameter>
+            <parameter>
+               <name>wsdlTargetNamespace</name>
+               <value>http://ws.apache.org/eventing/services/EventSourcePort</value>
+            </parameter>            
+            <!--
+            <parameter>
+               <name>resourceKeyName</name>
+               <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+            </parameter>
+            -->
+         </resourceParams>
+      </resource>
+   </service>
+
+   <service name="NotificationPort">
+      <resource name="home" type="org.apache.ws.eventing.SubscriptionHome">
+         <resourceParams>
+            <parameter>
+               <name>serviceClassName</name>
+               <value>org.apache.ws.eventing.services.BrokerService</value>
+            </parameter>
+            <parameter>
+               <name>resourceClassName</name>
+               <value>org.apache.ws.eventing.Subscription</value>
+            </parameter>
+            <parameter>
+               <name>wsdlTargetNamespace</name>
+               <value>http://ws.apache.org/eventing/services/NotificationPort</value>
+            </parameter>            
+            <parameter>
+               <name>resourceKeyName</name>
+               <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+            </parameter>
+         </resourceParams>
+      </resource>
+   </service>
+</jndiConfig>
+    

Added: incubator/hermes/trunk/src/examples/broker/log4j.properties
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/log4j.properties?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/log4j.properties (added)
+++ incubator/hermes/trunk/src/examples/broker/log4j.properties Sun Mar 20 16:41:11 2005
@@ -0,0 +1,9 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=DEBUG, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
\ No newline at end of file

Added: incubator/hermes/trunk/src/examples/broker/topicspace.xml
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/broker/topicspace.xml?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/broker/topicspace.xml (added)
+++ incubator/hermes/trunk/src/examples/broker/topicspace.xml Sun Mar 20 16:41:11 2005
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wstop:topicSpace name="TopicSpaceExample1"
+targetNamespace="http://example.org/topicSpace/example1"
+xmlns:tns="http://example.org/topicSpace/example1"
+xmlns:xyz="http://example.org/anotherNamespace"
+xmlns:wstop=
+"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics" >
+<wstop:topic name="t1">
+<wstop:topic name="t2" messageTypes="xyz:m1 tns:m2"/>
+<wstop:topic name="t3" messageTypes="xyz:m3"/>
+</wstop:topic>
+<wstop:topic name="t4">
+<wstop:topic name="t5" messageTypes="tns:m3"/>
+<wstop:topic name="t6">
+</wstop:topic>
+</wstop:topic>
+</wstop:topicSpace>
\ No newline at end of file

Added: incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java (added)
+++ incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+/**
+ *
+ * @author  Stefan Lischke
+ */
+public class GUIConsumer implements org.apache.ws.pubsub.NotificationConsumer{
+    SubListModel comp;
+    private EndpointReference epr; 
+   
+    public GUIConsumer(String epr){
+        //TODO decouple epr 
+        //org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType e = org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance();
+        //org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI auri = org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI.Factory.newInstance(); 
+        org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType e = org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType.Factory.newInstance();
+        org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI auri = org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI.Factory.newInstance(); 
+        auri.setStringValue(epr);
+        e.setAddress(auri);    
+        //wrapper
+        this.epr= new XmlBeansEndpointReference(e);
+    }
+    /** Creates a new instance of PopUpConsumer */
+    public GUIConsumer(String epr, SubListModel comp) {
+        this(epr);
+        this.comp=comp;
+    }
+    public void notify(org.apache.ws.pubsub.Subscription subscription, Object message ){
+        try{
+//            String m = (String)message;
+//            comp.addData(new notentry(((org.apache.ws.eventing.Subscription)subscription).getID().toString(),m));    
+            comp.addData(message);    
+        }catch(Exception e){
+            e.printStackTrace();
+        }
+    }
+    
+    public void end(org.apache.ws.pubsub.Subscription subscription, java.net.URI status, String reason) {
+        System.out.println("Killed Subscription "+reason);
+        comp.removeData(subscription);
+    }
+    
+    public EndpointReference getEPR() {
+        return this.epr;
+    }
+    
+}
+

Added: incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java (added)
+++ incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+/**
+ *
+ * @author  Stefan Lischke
+ */
+public class GUIEndConsumer implements org.apache.ws.pubsub.SubscriptionEndConsumer{
+    NotListModel comp;
+    private EndpointReference epr; 
+   
+    public GUIEndConsumer(String epr){
+        //TODO decouple epr 
+        org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType e = org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance();
+        org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI auri = org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI.Factory.newInstance(); 
+        //org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType e = org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType.Factory.newInstance();
+        //org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI auri = org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI.Factory.newInstance(); 
+        auri.setStringValue(epr);
+        e.setAddress(auri);    
+        //wrapper
+        this.epr= new XmlBeansEndpointReference(e);
+    }
+    /** Creates a new instance of PopUpConsumer */
+    public GUIEndConsumer(String epr, NotListModel comp) {
+        this(epr);
+        this.comp=comp;
+    }
+    
+    public void end(org.apache.ws.pubsub.Subscription subscription, String reason) {
+        System.out.println("Killed Subscription "+reason);
+        comp.removeData(subscription);
+    }
+    
+    public EndpointReference getEPR() {
+        return this.epr;
+    } 
+    
+}
+

Added: incubator/hermes/trunk/src/examples/pubsubclient/JettyAxisServer.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/JettyAxisServer.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/JettyAxisServer.java (added)
+++ incubator/hermes/trunk/src/examples/pubsubclient/JettyAxisServer.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.
+ */
+
+import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.utils.Messages;
+import org.apache.axis.utils.Options;
+import org.apache.commons.logging.Log;
+import org.mortbay.http.HttpContext;
+import org.mortbay.http.HttpServer;
+import org.mortbay.http.SocketListener;
+import org.mortbay.http.handler.ResourceHandler;
+import org.mortbay.jetty.servlet.ServletHandler;
+
+import java.net.MalformedURLException;
+
+public class JettyAxisServer {
+    public static Log log =
+            LogFactory.getLog(JettyAxisServer.class.getName());
+
+    /**
+     * Jetty HTTP Server *
+     */
+    HttpServer server = new HttpServer();
+
+    /**
+     * Socket Listener *
+     */
+    SocketListener listener = new SocketListener();
+
+    /**
+     * HTTP Context
+     */
+    HttpContext context = new HttpContext();
+
+    public JettyAxisServer() {
+        // Create a context 
+        context.setContextPath("/axis/*");
+        server.addContext(context);
+      
+        // Create a servlet container
+        ServletHandler servlets = new ServletHandler();
+        context.addHandler(servlets);
+
+        // Map a servlet onto the container
+        servlets.addServlet("AdminServlet", "/servlet/AdminServlet",
+                "org.apache.axis.transport.http.AdminServlet");
+        servlets.addServlet("AxisServlet", "/servlet/AxisServlet",
+                "org.apache.ws.resource.handler.axis.WsrfAxisServlet");
+        servlets.addServlet("AxisServlet", "/services/*",
+                "org.apache.ws.resource.handler.axis.WsrfAxisServlet");
+        //servlets.addServlet("AxisServlet", "*.jws",
+        //        "org.apache.axis.transport.http.AxisServlet");
+        context.addHandler(new ResourceHandler());
+    }
+
+    /**
+     * Set the port
+     *
+     * @param port
+     */
+    public void setPort(int port) {
+        listener.setPort(port);
+        server.addListener(listener);
+    }
+
+    /**
+     * Set the resource base
+     *
+     * @param dir
+     */
+    public void setResourceBase(String dir) {
+        context.setResourceBase(dir);
+    }
+
+    /**
+     * Start the server
+     *
+     * @throws Exception
+     */
+    public void start() throws Exception {
+        server.start();
+        log.info(
+                Messages.getMessage("start00", "JettyAxisServer",
+                        new Integer(listener.getServerSocket().getLocalPort()).toString()));
+    }
+
+    /*
+    public static void main(String[] args) {
+        Options opts = null;
+        try {
+            opts = new Options(args);
+        } catch (MalformedURLException e) {
+            log.error(Messages.getMessage("malformedURLException00"), e);
+            return;
+        }
+        JettyAxisServer server = new JettyAxisServer();
+        server.setPort(opts.getPort());
+        String dir = opts.isValueSet('d');
+        if (dir == null) {
+            // Serve static content from the context
+            dir = System.getProperty("jetty.home", ".") + "/webapps/axis/";
+        }
+        server.setResourceBase(dir);
+        
+        // Start the http server
+        try {
+            server.start();
+        } catch (Exception e) {
+            log.error(Messages.getMessage("exception00"), e);
+        }
+    }
+    */
+}
\ No newline at end of file

Added: incubator/hermes/trunk/src/examples/pubsubclient/NotListModel.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/NotListModel.java?view=auto&rev=158387
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/NotListModel.java (added)
+++ incubator/hermes/trunk/src/examples/pubsubclient/NotListModel.java Sun Mar 20 16:41:11 2005
@@ -0,0 +1,37 @@
+import javax.swing.AbstractListModel;
+
+class NotListModel extends AbstractListModel {
+    private java.util.Vector myData;
+    
+    public NotListModel() {
+        myData=new java.util.Vector();
+    }
+    
+    public int  getSize() { return myData.size();}
+    public Object getElementAt(int i) { return myData.elementAt(i);}
+    
+    public void addData(Object obj) {
+        myData.add(obj);    //Add data to the vector.
+        fireContentsChanged(this,0,myData.size()-1);    //fire event so that List updates itself.
+    }
+    
+    public void removeData(Object obj) {
+        myData.remove(obj);    //Add data to the vector.
+        fireContentsChanged(this,0,myData.size()-1);    //fire event so that List updates itself.
+    }
+    /*
+    public class notentry{
+        public String id;
+        public String content;
+        public notentry(String id, Object message)throws Exception{
+            this.id=id;
+            this.content=((org.apache.axis.message.SOAPEnvelope)message).getBody().toString();
+        }
+        
+        public String toString(){
+            return id;//+" "+content;
+        }
+        
+    }
+    */
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: hermes-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: hermes-dev-help@ws.apache.org


Mime
View raw message