incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r537160 - in /incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba: CorbaBindingFactory.java interceptors/CorbaStreamOutEndingInterceptor.java interceptors/CorbaStreamOutInterceptor.java runtime/CorbaStreamWriter.java
Date Fri, 11 May 2007 11:06:10 GMT
Author: bravi
Date: Fri May 11 04:06:09 2007
New Revision: 537160

URL: http://svn.apache.org/viewvc?view=rev&rev=537160
Log:
[YOKO-366] - Created a branch to work on refactoring the cxf based interceptors to be performant.

Added:
    incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutEndingInterceptor.java
  (with props)
    incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutInterceptor.java
  (with props)
    incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStreamWriter.java
  (with props)
Modified:
    incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingFactory.java

Modified: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingFactory.java?view=diff&rev=537160&r1=537159&r2=537160
==============================================================================
--- incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingFactory.java
(original)
+++ incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingFactory.java
Fri May 11 04:06:09 2007
@@ -31,6 +31,8 @@
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.BindingFactoryManager;
 
+import org.apache.cxf.interceptor.BareOutInterceptor;
+
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 
@@ -103,6 +105,7 @@
         binding.getOutInterceptors().add(new CorbaStreamOutInterceptor());
         binding.getInFaultInterceptors().add(new CorbaFaultInInterceptor());
         binding.getOutFaultInterceptors().add(new CorbaFaultOutInterceptor());
+        binding.getOutInterceptors().add(new BareOutInterceptor());
         binding.setBindingInfo(bindingInfo);
         return binding;
     }

Added: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutEndingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutEndingInterceptor.java?view=auto&rev=537160
==============================================================================
--- incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutEndingInterceptor.java
(added)
+++ incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutEndingInterceptor.java
Fri May 11 04:06:09 2007
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.yoko.bindings.corba.interceptors;
+
+import java.util.logging.Logger;
+
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.message.Message;
+
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+import org.apache.yoko.bindings.corba.CorbaMessage;
+import org.apache.yoko.bindings.corba.runtime.CorbaStreamWriter;
+
+public class CorbaStreamOutEndingInterceptor extends AbstractPhaseInterceptor<Message>
{
+
+    private static final Logger LOG = LogUtils.getL7dLogger(CorbaStreamOutEndingInterceptor.class);
+    
+    public CorbaStreamOutEndingInterceptor() {
+        super();
+        setPhase(Phase.USER_STREAM);
+    }
+
+    public void handleMessage(Message msg) {
+        System.out.println("CorbaStreamOutEndingInterceptor... handle message...");
+        CorbaMessage message = (CorbaMessage) msg;
+        CorbaStreamWriter writer = (CorbaStreamWriter) message.getContent(XMLStreamWriter.class);
  
+    }
+
+}

Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutEndingInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutEndingInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutInterceptor.java?view=auto&rev=537160
==============================================================================
--- incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutInterceptor.java
(added)
+++ incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutInterceptor.java
Fri May 11 04:06:09 2007
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.yoko.bindings.corba.interceptors;
+
+import java.util.logging.Logger;
+
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+import org.apache.yoko.bindings.corba.CorbaMessage;
+import org.apache.yoko.bindings.corba.runtime.CorbaStreamWriter;
+
+public class CorbaStreamOutInterceptor extends AbstractPhaseInterceptor<Message> {
+
+    private static final Logger LOG = LogUtils.getL7dLogger(CorbaStreamOutInterceptor.class);
+    
+    public CorbaStreamOutInterceptor() {
+        super();
+        setPhase(Phase.SETUP);
+    }
+
+    public void handleMessage(Message msg) {
+        System.out.println("CorbaStreamOutInterceptor... handleMessage...");
+        CorbaMessage message = (CorbaMessage) msg;
+        
+        CorbaStreamWriter writer = new CorbaStreamWriter();
+        message.setContent(XMLStreamWriter.class, writer);
+
+        message.getInterceptorChain().add(new CorbaStreamOutEndingInterceptor());
+    }
+
+}

Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaStreamOutInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStreamWriter.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStreamWriter.java?view=auto&rev=537160
==============================================================================
--- incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStreamWriter.java
(added)
+++ incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStreamWriter.java
Fri May 11 04:06:09 2007
@@ -0,0 +1,213 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.yoko.bindings.corba.runtime;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+public class CorbaStreamWriter implements XMLStreamWriter {
+
+    QName currentElement;
+    String defaultNS = "";
+    String currentChars;
+
+    public CorbaStreamWriter() {
+        //ctx = new NamespaceContextImpl();
+    }
+
+    public void writeStartElement(String namespaceURI, String localName)
+        throws XMLStreamException {
+        currentElement = new QName(namespaceURI, localName);
+        System.out.println("Start : " + currentElement);
+    }
+
+    public void writeEndElement() throws XMLStreamException {
+        System.out.println("End: " + currentElement);
+        currentElement = null;
+    }
+
+    public void writeStartElement(java.lang.String localName)
+        throws XMLStreamException {
+        currentElement = new QName(defaultNS, localName);
+        System.out.println("Check the start Element: " + currentElement);
+    }
+
+    public void writeStartElement(java.lang.String prefix,
+                                  java.lang.String localName,
+                                  java.lang.String namespaceURI)
+        throws XMLStreamException {     
+        setPrefix(prefix, namespaceURI);
+        currentElement = new QName(namespaceURI, localName, prefix);
+        System.out.println("Check the start Element: " + currentElement);
+    }
+
+    public void writeEmptyElement(java.lang.String namespaceURI,
+                                  java.lang.String localName)
+        throws XMLStreamException {
+        writeStartElement(namespaceURI, localName);
+        writeEndElement();
+    }
+
+    public void writeEmptyElement(java.lang.String prefix,
+                                  java.lang.String localName,
+                                  java.lang.String namespaceURI)
+        throws XMLStreamException {
+        writeStartElement(namespaceURI, localName, prefix);
+        writeEndElement();
+    }
+
+    public void writeEmptyElement(java.lang.String localName)
+        throws XMLStreamException {
+        writeStartElement(localName);
+        writeEndElement();
+    }
+    
+    public void writeEndDocument()
+        throws XMLStreamException {
+    }
+
+    public void close()
+        throws XMLStreamException {
+    }
+
+    public void flush()
+        throws XMLStreamException {
+    }
+
+    public void writeAttribute(java.lang.String localName,
+                               java.lang.String value)
+        throws XMLStreamException {
+        System.out.println("attr: " + localName + "-" + value);
+    }
+
+    public void writeAttribute(java.lang.String prefix,
+                               java.lang.String namespaceURI,
+                               java.lang.String localName,
+                               java.lang.String value)
+        throws XMLStreamException {
+        System.out.println("attr: " + prefix + "-" + namespaceURI + "-" + localName + "-"
+ value);
+    }
+
+    public void writeAttribute(java.lang.String namespaceURI,
+                               java.lang.String localName,
+                               java.lang.String value)
+        throws XMLStreamException {
+        System.out.println("attr: " + namespaceURI + "-" + localName + "-" + value);
+    }
+
+    public void writeNamespace(java.lang.String prefix,
+                               java.lang.String namespaceURI)
+        throws XMLStreamException {
+        setPrefix(prefix, namespaceURI);
+    }
+
+    public void writeDefaultNamespace(java.lang.String namespaceURI)
+        throws XMLStreamException {
+        defaultNS = namespaceURI;
+    }
+
+    public void writeComment(java.lang.String data)
+        throws XMLStreamException {
+    }
+
+    public void writeProcessingInstruction(java.lang.String target)
+        throws XMLStreamException {
+    }
+
+    public void writeProcessingInstruction(java.lang.String target,
+                                           java.lang.String data)
+        throws XMLStreamException {
+    }
+
+    public void writeCData(java.lang.String data)
+        throws XMLStreamException {
+    }
+
+    public void writeDTD(java.lang.String dtd)
+        throws XMLStreamException {
+    }
+
+    public void writeEntityRef(java.lang.String name)
+        throws XMLStreamException {
+    }
+
+    public void writeStartDocument()
+        throws XMLStreamException {
+    }
+
+    public void writeStartDocument(java.lang.String encoding,
+                                   java.lang.String version)
+        throws XMLStreamException {
+    }
+
+    public void writeStartDocument(java.lang.String version)
+        throws XMLStreamException {
+    }
+
+    public void writeCharacters(java.lang.String text)
+        throws XMLStreamException {
+        currentChars = text;
+        System.out.println("current chars: " + currentChars);
+    }
+
+    public void writeCharacters(char[] text,
+                                int start,
+                                int len)
+        throws XMLStreamException {
+        throw new XMLStreamException("Not yet implemented");
+    }
+
+    public java.lang.String getPrefix(java.lang.String uri)
+        throws XMLStreamException {
+        //return ctx.getPrefix(uri);
+        return null;
+    }
+
+    public void setPrefix(java.lang.String prefix,
+                          java.lang.String uri)
+        throws XMLStreamException {
+        //ctx.setPrefix(prefix, uri);
+    }
+
+    public void setDefaultNamespace(java.lang.String uri)
+        throws XMLStreamException {
+        defaultNS = uri;
+    }
+
+    public void setNamespaceContext(NamespaceContext context)
+        throws XMLStreamException {
+        throw new XMLStreamException("Not yet implemented");
+    }
+
+    public NamespaceContext getNamespaceContext() {
+        //return ctx;
+        return null;
+    }
+
+    public java.lang.Object getProperty(java.lang.String name)
+        throws java.lang.IllegalArgumentException {
+        return null;
+    }
+    
+}

Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStreamWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStreamWriter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message