Java Doc for MuxStream.java in  » Web-Server » Jigsaw » org » w3c » www » mux » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Jigsaw » org.w3c.www.mux 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.www.mux.MuxStream

MuxStream
public class MuxStream (Code)


Field Summary
protected  booleanalive
    
protected  MuxStreamHandlerhandler
     That stream accept handler.
protected  InputStreamin
     The raw input stream.
protected  InetAddressinetaddr
    
protected  OutputStreamout
     The raw output stream.
protected  MuxReaderreader
     This stream reader.
protected  booleanserver
    
protected  MuxSessionsessions
     Currently defined sessions.
protected  MuxWriterwriter
     This stream writer.

Constructor Summary
public  MuxStream(boolean server, MuxStreamHandler handler, InputStream in, OutputStream out)
    
public  MuxStream(boolean server, MuxStreamHandler handler, Socket socket)
    

Method Summary
public  MuxSessionconnect(int protid)
     Create a new MUX session, by connecting to the other end.
Parameters:
  protid - The protocol that is going to be spoken on that new session.
protected  voidctrlDefineStack(int id, int stack)
     Handle the given DefineStack control message.
protected  voidctrlDefineString(int strid, String str)
     Handle the given DefineString control message.
protected  voidctrlMuxControl(int sessid, int fragsz)
     Handle the given MuxControl control message.
protected  voidctrlSendCredit(int sessid, int credit)
     Handle the given SendCredit control message.
protected  voiderror(Object obj, Exception ex)
     A severe (fatal for that connection) errror has occured.
protected synchronized  voiderror(Object obj, String msg)
     A soft error has occured (eg socket close), Cleanup.
public  InetAddressgetInetAddress()
     Get the InetAddress associated with that MUX stream, if any. MUX streams can run on any kind of Input/Output streams.
final protected  MuxWritergetMuxWriter()
     Get this stream MuxWriter object.
protected  MuxSessionlookupSession(int flags, int sessid, int length, int llength)
     Handle that new incomming message.
protected synchronized  MuxSessionlookupSession(int sessid, boolean check)
     Lookup for an already existing session having the given identifier.
Parameters:
  sessid - The identifier of the session to look for.
Parameters:
  check - Is null a valid answer, if set andthe requested session doesn't exist, a runtime exception is thrown.
public synchronized  booleanshutdown(boolean force)
     Shutdown this stream, and associated sessions gracefully.
Parameters:
  force - If true abort all existing sessions, andclose the muxed streams physically.
protected synchronized  voidunregisterSession(MuxSession session)
     Unregiter the given session, it has been closed.

Field Detail
alive
protected boolean alive(Code)
Is this muxed stream still alive ?



handler
protected MuxStreamHandler handler(Code)
That stream accept handler.



in
protected InputStream in(Code)
The raw input stream.



inetaddr
protected InetAddress inetaddr(Code)
Inet address of the other end's connection (maybe null)



out
protected OutputStream out(Code)
The raw output stream.



reader
protected MuxReader reader(Code)
This stream reader.



server
protected boolean server(Code)
Is this the server side of the MUX channel ?



sessions
protected MuxSession sessions(Code)
Currently defined sessions.



writer
protected MuxWriter writer(Code)
This stream writer.




Constructor Detail
MuxStream
public MuxStream(boolean server, MuxStreamHandler handler, InputStream in, OutputStream out) throws IOException(Code)



MuxStream
public MuxStream(boolean server, MuxStreamHandler handler, Socket socket) throws IOException(Code)




Method Detail
connect
public MuxSession connect(int protid) throws IOException(Code)
Create a new MUX session, by connecting to the other end.
Parameters:
  protid - The protocol that is going to be spoken on that new session. A connected MuxSession.
exception:
  IOException - If the connection couldn't be set up properly.



ctrlDefineStack
protected void ctrlDefineStack(int id, int stack) throws IOException(Code)
Handle the given DefineStack control message.
Parameters:
  id - The identifier for that stack in the future.
Parameters:
  stack - The stack description (as an array of shorts).



ctrlDefineString
protected void ctrlDefineString(int strid, String str)(Code)
Handle the given DefineString control message.
Parameters:
  strid - The identifier for that String in the futur.
Parameters:
  str - This String being defined.



ctrlMuxControl
protected void ctrlMuxControl(int sessid, int fragsz) throws IOException(Code)
Handle the given MuxControl control message.
Parameters:
  sessid - The session to which that message applies.
Parameters:
  fragsz - The max allowed fragment size on that session.



ctrlSendCredit
protected void ctrlSendCredit(int sessid, int credit) throws IOException(Code)
Handle the given SendCredit control message.
Parameters:
  sessid - The session to which that message applies.
Parameters:
  credit - The allowed credits.



error
protected void error(Object obj, Exception ex)(Code)
A severe (fatal for that connection) errror has occured. Cleanup.
Parameters:
  obj - The object that has generated the error.
Parameters:
  ex - The exception that triggered the error (or null null if this was a logical error).



error
protected synchronized void error(Object obj, String msg)(Code)
A soft error has occured (eg socket close), Cleanup.
Parameters:
  obj - The object that has detected the soft error.
Parameters:
  msg - An associated String message.



getInetAddress
public InetAddress getInetAddress()(Code)
Get the InetAddress associated with that MUX stream, if any. MUX streams can run on any kind of Input/Output streams. This method will only return a non-null instance when possible. An InetAddress instance, or null if notavailable.



getMuxWriter
final protected MuxWriter getMuxWriter()(Code)
Get this stream MuxWriter object. A MuxWriter instance.



lookupSession
protected MuxSession lookupSession(int flags, int sessid, int length, int llength) throws IOException(Code)
Handle that new incomming message. This method is called by the reader of that session, to dispatch the message currently being read. A MuxSession instance to dispatch that message to, ornull otherwise (ie a new session was rejected, etc).In that last case, it is up to the reader of that session to discard any pending data.



lookupSession
protected synchronized MuxSession lookupSession(int sessid, boolean check)(Code)
Lookup for an already existing session having the given identifier.
Parameters:
  sessid - The identifier of the session to look for.
Parameters:
  check - Is null a valid answer, if set andthe requested session doesn't exist, a runtime exception is thrown. A MuxSession instance, or null if check isfalse and no session was found.



shutdown
public synchronized boolean shutdown(boolean force) throws IOException(Code)
Shutdown this stream, and associated sessions gracefully.
Parameters:
  force - If true abort all existing sessions, andclose the muxed streams physically. Otherwise, shutdown the muxed streamgracefully only if no more sessions are running. A boolean, true if shutdown was performed,false if it was not performed because forcewas false and some sessions were still running.
exception:
  IOException - If some IO error occured.



unregisterSession
protected synchronized void unregisterSession(MuxSession session)(Code)
Unregiter the given session, it has been closed.
Parameters:
  session - The session to unregister.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.