Collect the personal reply to the last article --- find a tree to hang

xiaoxiao2021-03-06  37

#

Use place to use

2004-12-06 2:23 PM

Find a tree to hang

Today, I looked at the RMI, I understood what is going on when STUB and Skelen in EJB. I have always regarded Skelen's STUB and server-side Skelen in EJB to be "agents". In fact, this is "I just" Understand the error. Stub and Skelen are a bit similar, it is the parameters transmitted by the client to the grid in the grid through Stub, of course, STUB will also be network information (IP, JRMP protocol ASCII code, etc. In addition, in order to ignore different coding of different machines, Java uses a unified grid form. The client does not allow "reference", because the address in the server is not a matter at all. Therefore, the parameters of the Class are required must be serialized.

When the server side, one of Skelen's tasks is "decoding" (aunt, you can consider the network model). Take the main 咚咚 (passing parameters, the class name, method name) "Translate" After the method, the result is "packaged" into the form of the client. In order to save network resources, the server side can pass "reference" (because the server is fixed, its pointer is fixed). ^ _ ^ I didn't think of "Quote" in the specific situation.

The client's Stub is "decoded" to get the corresponding result.

#

占 --- About flow

2004-12-06 2:48 PM

Find a tree to hang

I remember that when I just learned Java, the convection understanding was very angry. After understanding the concept of flow, I was inexplicable in New a stream in the construction of a stream. I finally be a bit eyebrow, so this record is as follows:

Solution,

Enter the stream - you can think of it as a source, the source of what you want. For example, you want to get the 咚咚 in a file, then initialize the input stream.

Output stream - you can think of it as a writing board (for a bit), such as writing something in a file, then initializing the output stream

2. Nested in the stream -

First look at the classification of the stream (my own class, ^ _ ^). A. Basic stream b. Package. The nest of the stream is the New Package Flow (New Basal Flow) of this.

OK, understand? The outermost layer is the packaging flow, the basic flow is the basic flow (people like dressing, the stream is no exception). Of course, the package will have the advantages of packaging, such as the package after packaging, can call the packaging process To meet the different requirements of different people.

Basic stream: InputStream, ByteaRayinputStream, FileInputStream, etc. (including corresponding OutputStream)

Packaging stream: FilterInputStream, BufferedInputStream, DataInputStream, LinenumberinputStream, PushbackInputStream, and related OutputStream.

# A simple example on the date (from the network)

Public static void main (String [] args) {

Date now = new date ();

// DateFormat defaultformat = DateFormat.getdateInstance ();

// DateFormat ShortFormat = DateFormat.getdateInstance (DateFormat.short);

// DateFormat MediumFormat = DateFormat.GetdateInstance (DateFormat.medium);

// DateFormat longformat = DateFormat.getdateInstance (DateFormat.long);

// DateFormat FullFormat = DateFormat.GetdateInstance (DateFormat.full);

Dateformat defaultformat = dateformat.getdatetimeInstance ();

DateFormat shortFormat = DateFormat.getDateTimeInstance (DateFormat.SHORT, DateFormat.SHORT, Locale.CHINA); DateFormat mediumFormat = DateFormat.getDateTimeInstance (DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.CHINA);

DateFormat LongFormat = DateFormat.getdateTimeInstance (DateFormat.long, DateFormat.long, Locale.china);

DateFormat FullFormat = DateFormat.GetdateTimeInstance (DateFormat.full, DateFormat.full, Locale.China);

String defaultdate = defaultformat.format (now);

String shortdate = shortformat.format (now);

String Mediumdate = MediumFormat.Format (now);

String longdate = longformat.format (now);

String fulldate = fullformat.format (now);

System.out.println ("(Default) Today:" defaultdate);

System.out.println ("(Short) Today:" shortdate);

System.out.println ("(Medium) Today:" Mediumdate);

System.out.println ("(long) Today:" longdate);

System.out.println ("(FULL) Today:" fulldate);

}

转载请注明原文地址:https://www.9cbs.com/read-84034.html

New Post(0)