Author: alessio.soldano(a)jboss.com
Date: 2007-12-12 12:28:19 -0500 (Wed, 12 Dec 2007)
New Revision: 5280
Removed:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingRequestHandlerImpl.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordWriterProcessor.java
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordExtractor.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
Log:
Deleting useless classes + comments + typos
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2007-12-12
17:27:25 UTC (rev 5279)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2007-12-12
17:28:19 UTC (rev 5280)
@@ -53,7 +53,6 @@
@Override
public void create(Deployment dep)
{
- System.out.println("DEPLOYOOOOOOOO");
for (Endpoint ep : dep.getService().getEndpoints())
{
/** Record buffer **/
Deleted:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingRequestHandlerImpl.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingRequestHandlerImpl.java 2007-12-12
17:27:25 UTC (rev 5279)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingRequestHandlerImpl.java 2007-12-12
17:28:19 UTC (rev 5280)
@@ -1,209 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * 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.jboss.wsf.framework.invocation;
-
-//$Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletInputStream;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.common.IOUtils;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-
-/**
- * A request handler that records requests and responses
- *
- * @author alessio.soldano(a)jboss.org
- * @since 06-Dec-2007
- */
-public class RecordingRequestHandlerImpl implements RequestHandler
-{
-
- private RequestHandler delegateHandler;
-
- public RecordingRequestHandlerImpl(RequestHandler delegateHandler)
- {
- this.delegateHandler = delegateHandler;
- }
-
- public void handleHttpRequest(Endpoint endpoint, HttpServletRequest req,
HttpServletResponse res, ServletContext context) throws ServletException, IOException
- {
- Logger.getLogger(this.getClass()).info("*** handleHttpRequest");
-
- byte[] bytes = readInputStream(req.getInputStream());
- Logger.getLogger(this.getClass()).info("REQUEST: "+new String(bytes));
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- delegateHandler.handleHttpRequest(endpoint, new DelegatingRequestWrapper(req, new
ByteArrayInputStream(bytes)), new DelegatingResponseWrapper(res, baos), context);
- Logger.getLogger(this.getClass()).info("RESPONSE: "+baos.toString());
- }
-
- public void handleRequest(Endpoint endpoint, InputStream inputStream, OutputStream
outputStream, InvocationContext context) throws IOException
- {
- Logger.getLogger(this.getClass()).info("*** handleRequest");
-
- byte[] bytes = readInputStream(inputStream);
- Logger.getLogger(this.getClass()).info("REQUEST: "+new String(bytes));
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- delegateHandler.handleRequest(endpoint, new ByteArrayInputStream(bytes), new
DoubleOutputStream(outputStream, baos), context);
- Logger.getLogger(this.getClass()).info("RESPONSE: "+baos.toString());
- }
-
- public void handleWSDLRequest(Endpoint endpoint, OutputStream output,
InvocationContext context) throws IOException
- {
- Logger.getLogger(this.getClass()).info("*** handleWSDLRequest");
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- delegateHandler.handleWSDLRequest(endpoint, new DoubleOutputStream(output, baos),
context);
- Logger.getLogger(this.getClass()).info("RESPONSE: "+baos.toString());
- }
-
- private byte[] readInputStream(InputStream is) throws IOException
- {
- ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
- IOUtils.copyStream(os, is);
- return os.toByteArray();
- }
-
- /**
- * A HttpServletRequestWrapper that uses a given input stream.
- * It delegates everything else to the original request wrapper.
- *
- */
- private class DelegatingRequestWrapper extends HttpServletRequestWrapper
- {
- private InputStream inputStream;
- private ServletInputStream servletInputStream;
-
- public DelegatingRequestWrapper(HttpServletRequest httpServletRequest, InputStream
inputStream)
- {
- super(httpServletRequest);
- this.inputStream = inputStream;
- }
-
- @Override
- public ServletInputStream getInputStream() throws IOException
- {
- if (servletInputStream == null)
- {
- servletInputStream = new DelegatingInputStream(inputStream);
- }
- return servletInputStream;
- }
- }
-
- /**
- * A ServletInputStream that delegates read invocations
- * to a given input stream.
- *
- */
- private class DelegatingInputStream extends ServletInputStream
- {
- private InputStream inputStream;
-
- public DelegatingInputStream(InputStream inputStream)
- {
- this.inputStream = inputStream;
- }
-
- @Override
- public int read() throws IOException
- {
- return inputStream.read();
- }
- }
-
- /**
- * A HttpServletResponseWrapper that uses a given output stream.
- * It delegates everything else to the original response wrapper.
- *
- */
- private class DelegatingResponseWrapper extends HttpServletResponseWrapper
- {
- private OutputStream outputStream;
- private ServletOutputStream servletOutputStream;
-
- public DelegatingResponseWrapper(HttpServletResponse httpServletResponse,
OutputStream outputStream)
- {
- super(httpServletResponse);
- this.outputStream = outputStream;
- }
-
- @Override
- public ServletOutputStream getOutputStream() throws IOException
- {
- if (servletOutputStream == null)
- {
- servletOutputStream = new DoubleOutputStream(super.getOutputStream(),
outputStream);
- }
- return servletOutputStream;
- }
- }
-
- /**
- * A ServletOutputStream that delegates write invocations
- * to two given output streams.
- *
- */
- private class DoubleOutputStream extends ServletOutputStream
- {
- private OutputStream first;
- private OutputStream second;
-
- public DoubleOutputStream(OutputStream first, OutputStream second)
- {
- this.first = first;
- this.second = second;
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException
- {
- first.write(b, off, len);
- second.write(b, off, len);
- }
-
- @Override
- public void write(int b) throws IOException
- {
- first.write(b);
- second.write(b);
- }
- }
-
-}
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java 2007-12-12
17:27:25 UTC (rev 5279)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java 2007-12-12
17:28:19 UTC (rev 5280)
@@ -63,12 +63,11 @@
@SuppressWarnings("unchecked")
protected boolean handleInbound(MessageContext ctx)
{
- log.info("*** INBOUND ***");
Endpoint endpoint = EndpointAssociation.getEndpoint();
if (this.isRecording(endpoint))
{
Record record = RecordFactory.newRecord();
- RecordGroupAssociation.pushGroupID(record.getGroupID());//check, perhaps we
should try peeking before pushing...
+ RecordGroupAssociation.pushGroupID(record.getGroupID());
record.setDate(new Date());
HttpServletRequest httpServletRequest =
(HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
if (httpServletRequest != null)
@@ -116,10 +115,9 @@
protected boolean handleOutbound(MessageContext ctx)
{
Endpoint endpoint = EndpointAssociation.getEndpoint();
- log.info("*** OUTBOUND ***");
if (this.isRecording(endpoint))
{
- String groupID = RecordGroupAssociation.popGroupID();//check, perhaps we should
try peeking before popping...
+ String groupID = RecordGroupAssociation.popGroupID();
Record record = RecordFactory.newRecord(groupID);
record.setDate(new Date());
record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_RESPONSE_HEADERS)));
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java 2007-12-12
17:27:25 UTC (rev 5279)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java 2007-12-12
17:28:19 UTC (rev 5280)
@@ -24,8 +24,6 @@
//$Id$
import java.util.List;
-import java.util.Map;
-import java.util.Set;
import org.jboss.wsf.spi.management.recording.Record;
import org.jboss.wsf.spi.management.recording.RecordFilter;
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordExtractor.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordExtractor.java 2007-12-12
17:27:25 UTC (rev 5279)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordExtractor.java 2007-12-12
17:28:19 UTC (rev 5280)
@@ -31,7 +31,7 @@
import org.jboss.wsf.spi.management.recording.RecordFilter;
/**
- * A record extractor provide users with statistics about the collected records
+ * A record extractor provides users with statistics about the collected records
*
* @author alessio.soldano(a)jboss.com
* @since 12-Dec-2007
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2007-12-12
17:27:25 UTC (rev 5279)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2007-12-12
17:28:19 UTC (rev 5280)
@@ -33,6 +33,7 @@
import org.jboss.wsf.spi.management.recording.Record;
/**
+ * Default Record implementation
*
* @author alessio.soldano(a)jboss.com
* @since 8-Dec-2007
Deleted:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordWriterProcessor.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordWriterProcessor.java 2007-12-12
17:27:25 UTC (rev 5279)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordWriterProcessor.java 2007-12-12
17:28:19 UTC (rev 5280)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * 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.jboss.wsf.framework.management.recording;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.management.recording.Record;
-
-/**
- *
- * @author alessio.soldano(a)jboss.com
- * @since 8-Dec-2007
- */
-public class RecordWriterProcessor extends AbstractRecordProcessor
-{
- private Logger log = Logger.getLogger(this.getClass());
-
- @Override
- public void processRecord(Record arg0)
- {
- log.info("TODO");
- log.info(this);
- }
-
-}