当前位置: 首页>>代码示例>>Java>>正文


Java WriteListener类代码示例

本文整理汇总了Java中javax.servlet.WriteListener的典型用法代码示例。如果您正苦于以下问题:Java WriteListener类的具体用法?Java WriteListener怎么用?Java WriteListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WriteListener类属于javax.servlet包,在下文中一共展示了WriteListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {

  final ServletOutputStream outputStream = d.getOutputStream();
  return new ServletOutputStream() {

    @Override
    public void write(int b) throws IOException {
      respBody.write(b);
      outputStream.write(b);
    }

    @Override
    public void setWriteListener(WriteListener writeListener) {
      outputStream.setWriteListener(writeListener);
    }

    @Override
    public boolean isReady() {
      return outputStream.isReady();
    }
  };
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:24,代码来源:AccessLogFilter.java

示例2: setWriteListener

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public void setWriteListener(final WriteListener writeListener) {
    if (writeListener == null) {
        throw UndertowServletMessages.MESSAGES.paramCannotBeNull("writeListener");
    }
    if (listener != null) {
        throw UndertowServletMessages.MESSAGES.listenerAlreadySet();
    }
    listener = writeListener;
    channel.getWriteSetter().set(new WriteChannelListener());
    state |= FLAG_READY;
    ioExecutor.execute(new Runnable() {
        @Override
        public void run() {
            channel.resumeWrites();
        }
    });
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:UpgradeServletOutputStream.java

示例3: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
    return new ServletOutputStream() {
        @Override
        public boolean isReady() {
            return false;
        }

        @Override
        public void setWriteListener(WriteListener writeListener) {

        }

        private TeeOutputStream tee = new TeeOutputStream(ResponseWrapper.super.getOutputStream(), bos);

        @Override
        public void write(int b) throws IOException {
            tee.write(b);
        }
    };
}
 
开发者ID:warlock-china,项目名称:wisp,代码行数:22,代码来源:ResponseWrapper.java

示例4: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
    return new ServletOutputStream() {
        @Override
        public void write(int b) throws IOException {
            baos.write(b);
        }

        @Override
        public boolean isReady() {
            // TODO Auto-generated method stub
            return false;
        }

        @Override
        public void setWriteListener(WriteListener listener) {
            // TODO Auto-generated method stub

        }
    };
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:22,代码来源:BlobContentServletTest.java

示例5: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
	return new ServletOutputStream() {

		@Override
		public void write(int b) throws IOException {
			builder.append(new Character((char) b));
		}

		@Override
		public void setWriteListener(WriteListener listener) {
		}

		@Override
		public boolean isReady() {
			return true;
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-gateway,代码行数:20,代码来源:ProxyExchange.java

示例6: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
	if (servletOutputStream == null){
		servletOutputStream = new ServletOutputStream() {
			
			@Override
			public void write(int b) throws IOException {
				out.write(b);
			}
			
			@Override
			public void setWriteListener(WriteListener wl) {
				writeListener = wl;
			}
			
			@Override
			public boolean isReady() {
				return true;
			}
		};
	}
	return servletOutputStream;
}
 
开发者ID:ggeorgovassilis,项目名称:fauxjsp,代码行数:24,代码来源:ServletResponseWrapper.java

示例7: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
	if (out == null){
		out = new ServletOutputStream() {
			
			@Override
			public void write(int b) throws IOException {
				baos.write(b);
			}
			
			@Override
			public void setWriteListener(WriteListener writeListener) {
			}
			
			@Override
			public boolean isReady() {
				return false;
			}
		};
	}
	return out;
}
 
开发者ID:ggeorgovassilis,项目名称:fauxjsp,代码行数:23,代码来源:MockHttpServletResponse.java

示例8: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
    return new ServletOutputStream() {
        private TeeOutputStream tee = new TeeOutputStream(ResponseWrapper.super.getOutputStream(), bos);

        @Override
        public boolean isReady() {
            return true;
        }

        @Override
        public void setWriteListener(WriteListener writeListener) {
        }

        @Override
        public void write(int b) throws IOException {
            tee.write(b);
        }
    };
}
 
开发者ID:sofn,项目名称:app-engine,代码行数:21,代码来源:ResponseWrapper.java

示例9: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public synchronized ServletOutputStream getOutputStream() {
  checkState(writer == null, "getWriter() already called");
  if (outputStream == null) {
    outputStream =
        new ServletOutputStream() {
          @Override
          public void write(int c) throws IOException {
            actualBody.write(c);
          }

          @Override
          public boolean isReady() {
            return true;
          }

          @Override
          public void setWriteListener(WriteListener listener) {
            throw new UnsupportedOperationException();
          }
        };
  }
  return outputStream;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:25,代码来源:FakeHttpServletResponse.java

示例10: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
  return new ServletOutputStream() {

    @Override
    public void write(int b) throws IOException {
      outputStream.write(b);
    }

    @Override
    public void setWriteListener(WriteListener arg0) {}

    @Override
    public boolean isReady() {
      return true;
    }
  };
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:19,代码来源:AuthenticatedLoginHttpResponse.java

示例11: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
public ServletOutputStream getOutputStream() throws IOException {
//		return instace.getOutputStream();
		if (os == null) {
			os = new ByteArrayOutputStream();
			sos = new ServletOutputStream() {
				
				@Override
				public void write(int b) throws IOException {
					os.write(b);
				}

				@Override
				public boolean isReady() {
					return true;
				}

				@Override
				public void setWriteListener(WriteListener writeListener) {
				}
			};
		}
		return sos;
	}
 
开发者ID:mhus,项目名称:mhus-osgi-tools,代码行数:24,代码来源:DispatchedHttpServletResponse.java

示例12: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() {
  return new ServletOutputStream() {
    @Override
    public void write(int b) {
      baos.write(b);
    }

    @Override
    public boolean isReady() {
      return true;
    }

    @Override
    public void setWriteListener(WriteListener writeListener) {}
  };
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:18,代码来源:ByteArrayResponseWrapper.java

示例13: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
    return new ServletOutputStream() {
        private TeeOutputStream tee = new TeeOutputStream(ResponseWrapper.super.getOutputStream(), bos);

        @Override
        public void write(int b) throws IOException {
            tee.write(b);
        }

        @Override
        public boolean isReady() {
            // Auto-generated method stub
            return false;
        }

        @Override
        public void setWriteListener(WriteListener listener) {
            // Auto-generated method stub
        }
    };
}
 
开发者ID:RWTH-i5-IDSG,项目名称:BikeMan,代码行数:23,代码来源:ResponseWrapper.java

示例14: getOutputStream

import javax.servlet.WriteListener; //导入依赖的package包/类
@Override
public ServletOutputStream getOutputStream() throws IOException {
	
	return new ServletOutputStream(){

		@Override
		public boolean isReady() {				
			return true;
		}

		@Override
		public void setWriteListener(WriteListener writeListener) {
			
			
		}

		@Override
		public void write(int b) throws IOException {
			out.write(b);				
		}
		
	};
}
 
开发者ID:jbaliuka,项目名称:sql-analytic,代码行数:24,代码来源:MockHtppServletResponse.java

示例15: setUp

import javax.servlet.WriteListener; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	MockitoAnnotations.initMocks(this);
	
	bytes = new byte[] { (byte) 0x0 };
	inputStream = new ByteArrayInputStream(bytes);
	outputStream = new ByteArrayOutputStream();

	socketStream = new ServletOutputStream() {
		@Override
		public void write(int b) throws IOException {
			outputStream.write(b);
		}

		@Override
		public boolean isReady() {
			return false;
		}

		@Override
		public void setWriteListener(WriteListener writeListener) {
		}
	};

	when(response.getOutputStream()).thenReturn(socketStream);
}
 
开发者ID:caelum,项目名称:vraptor4,代码行数:27,代码来源:InputStreamDownloadTest.java


注:本文中的javax.servlet.WriteListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。