Paulex Yang (JIRA) wrote:
[
http://issues.apache.org/jira/browse/HARMONY-27?page=comments#action_12363230]
Paulex Yang commented on HARMONY-27:
------------------------------------
my proposed solution:
1. Refactor the java.net
Currently, the Harmony's socket structur is as below(red means API
classes, others are package private). I will attach the diagram to Jira.
"red"? I assume that you did this in HTML?
Please, no HTML - it's hard for people to read who don't use
HTML-enabled mail readers.... I for example, can't see it...
geir
I proposed to refactor to three packages like this:
java.net: for sure includes All API classes, and includes them only
public class Socket
public class ServerSocket
public abstract class SocketImpl
public class DatagramSocket
public class MulticastSocket extends DatagramSocket
public abstract class DatagramSocketImpl
org.apache.harmony.net: all implementation classes with a factory
public class SocketImplProvider
class PlainSocketImpl extends SocketImpl
class PlainSocketImpl2 extends PlainSocketImpl
class PlainServerSocketImpl extends PlainSocketImpl
class PlainDatagramSocketImpl extends DatagramSocketImpl
class PlainMulticastSocketImpl extends PlainDatagramSocketImpl
some relevant small classes(Socks4Message, GenericIPMreq)
org.apache.platform: currently, this package includes native file system
and memory management interface, so it is a good place to include the native
network interface, the INetworkSystem will encapsulate all JNI interfaces.
public interface INetworkSystem
public class OSNetworkSystem implements INetworkSystem
2. Implement java.nio
Now it is ready to implement NIO network channels based on it:
java.nio:
public abstract class SocketChannel
public abstract class ServerSocketChannel
public abstract class DatagramSocketChannel
class SocketChannelImpl
class ServerSocketImpl
class DatagramSocketChannelImpl
class SocketAdapter
class ServerSocketAdapter
class DatagramSocketAdapter
I will attach the result diagram into JIRA, too
3. Modulize them
According to the current Harmony modulization, propose to modify the
modulization as follows:
luni exports: java.net, org.apache.harmony.net,
org.apache.harmony.platform(move from nio to luni, and export it)
nio exports: java.nio
The network related channels in java.nio.channels are not implemented
---------------------------------------------------------------------
Key: HARMONY-27
URL: http://issues.apache.org/jira/browse/HARMONY-27
Project: Harmony
Type: Bug
Components: Classlib
Reporter: Paulex Yang
Assignee: Geir Magnusson Jr
The following classes defined by Java Spec 5.0 in java.nio.channels are
not included in the class library code
public abstarct class java.nio.channels.DatagramChannel
public abstract class java.nio.channels.ServerSocketChannel
public abstract class java.nio.channels.SocketChannel