當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。