With this in mind, complete the following HTTPProxyServer
class:
import java.io.*; import java.net.*; public HTTPProxyServer implements Runnable { private ServerSocket ss; public HTTPProxyServer(String actualHost, int actualPort, int intermediaryPort) { } public void run() { } }
You may create additional classes if needed.
author
element?
finalgrade
element
inside of a student
element?
width
attribute
inside of a trailer
element?
<play> <title>All's Well That Ends Well</title> <personae> <persona>KING OF FRANCE</persona> <persona>DUKE OF FLORENCE</persona> <persona>BERTRAM, Count of Rousillon.</persona> <persona>LAFEU, an old lord.</persona> </personae> </play>
Write an XSLT program that will convert an XML document containing a group of plays into a table with the title in the first column and the personae in subsequent columns (delimited by the '|' character). (Note: All plays will not have the same number of personae.)
DefaultHandler
and a driver) that can
use a SAXParser
to list all of the persona in a
play (of the kind in the previous question).
Posterizer
class. It had
a setMetric()
method that was passed
a Metric
and a toBlackAndWhite()
method
that was passed a BufferedImage
object. That version
was designed to run on a single machine. For this question you
must write a distributed version of this system using object
transport.
PosterizerParameters
class
that contains a Metric
and a BufferedImage
.
PosterizerServer
that can: receive a
PosterizerParameters
object, construct
a Posterizer
object, posterize the image
appropriately, and respond with the
transformed BufferedImage
. It must use TCP and
handle one connection at a time (to avoid conflicts).
PosterizerClient
that: serializes
a PosterizerParameters
object, transmits
the serialized version to
a PosterizerServer
, and receives the result.
import java.lang.reflect.*; public class ObjectFactory { /** * Uses reflection to create an Object of a given class * * @param className The name of the class (e.g., String) * @return An instance of the given class */ public Object createObject(String className) { } }
ObjectFactory
class above)
that can be used by remote clients to construct objects of different kinds.
One way to improve the efficiency of such situations is to have the clients connect to an "internal" proxy and have the proxy connect to the "external" server. With such a system, the information only needs to be transmitted from the "external" server once. Then, the "internal" proxy can re-transmit the information to each client.
Design such a system using servlets (in UML).
Copyright 2020