Ignore:
Timestamp:
07/06/13 03:51:11 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add proper exception passing between communication sides:

if exception occur during handling client request, it is
automatically passed as comment to error response.

it may be used to snoop communication between peers

  • fix algorithm choosing text controls in GUI
  • allow GUI testing in virtual frame buffer (xvfb)

FEST had some problem with xvfb but workaround was found

supports tab-completion based on requests history

CHANGELOG:
Further improve handling of exceptions in GUI.

Add StatusBar? implementing ExceptionResultHandler?.

Make completion processing asynchronous.

Minor changes.

Improve completion in console.

Improve history in InteractiveConsole?.

First working version of DirectConsole?.

Minor changes.

Make Connection.address non final.

It is more suitable to use in configuration.

Improvement of consoles.

Improve PopupMenu? and closing of FrameJoinable?.

Fix BrowserTest?.

Found bug with FEST running under xvfb.

JButtonFixture.click() is not working under xvfb.
GuiTest? has wrapper which uses JButton.doClick() directly.

Store CompositeParam? param in TreeNode?.

Simplify ClientSideManagedConnection? connecting.

There is now connectedFunctor needed, ApplicationRequests? can be
send right after creation. They are buffered until the version
and features are negotiated.

Narow down interface of ClientSideManagedConnection?.

Allow that connection specialization send only
ApplicationRequests?.

Improve policy of text control choosing.

Change name of Genotype in BrowserTest?.

Make BrowserTest? change name of Genotype.

Minor change.

First working draft of TrackConsole?.

Simplify Consoles.

More improvements with gui joinables.

Unify initialization on gui joinables.

More rework of Frame based entities.

Refactorize structure of JFrames based entities.

Extract GuiTest? from BrowserBaseTest?.

Reorganize Console classes structure.

Add Collection view to JoinableCollection?.

Configure timeout in testing.

Minor changes.

Rework connections hierarchy.

Add Mode to the get operation.

Make get and set in Tree take PrimitiveParam?.

Unify naming of operations.

Make RunAt? use the given ExceptionHandler?.

It wraps the virtual runAt() method call with
try-catch passing exception to handler.

Force RunAt? to include ExceptionHandler?.

Improve ClientAtServer?.

Minor change.

Another sweep with FindBugs?.

Rename Instance to Tree.

Minor changes.

Minor changes.

Further clarify semantics of Futures.

Add FutureHandler?.

FutureHandler? is refinement of Future, that proxifies
exception handling to ExceptionResultHandler? given
at construction time.

Remove StateFunctor? (use Future<Void> instead).

Make Connection use Future<Void>.

Unparametrize *ResponseFuture?.

Remove StateCallback? not needed anymore.

Distinguish between sides of ResponseFuture?.

Base ResponseCallback? on Future (now ResponseFuture?).

Make asynchronous store taking Future for flags.

Implement storeValue in ObjectInstance?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/hosting/Server.java

    r96 r97  
    44import org.apache.log4j.Logger;
    55
    6 import com.framsticks.core.Instance;
     6import com.framsticks.core.Tree;
    77import com.framsticks.params.annotations.AutoAppendAnnotation;
    88import com.framsticks.params.annotations.FramsClassAnnotation;
     
    1717import com.framsticks.util.dispatching.RunAt;
    1818import com.framsticks.util.dispatching.Task;
     19import com.framsticks.util.dispatching.ThrowExceptionHandler;
    1920
    2021import java.io.IOException;
     
    3233
    3334        protected ServerSocket acceptSocket;
    34         protected Instance hosted;
    35         protected final JoinableCollection<InstanceClient> clients = new JoinableCollection<InstanceClient>();
     35        protected Tree hosted;
     36        protected final JoinableCollection<ClientAtServer> clients = new JoinableCollection<ClientAtServer>();
    3637
    3738        public static class Accept {
     
    8081         * @return the hosted
    8182         */
    82         public Instance getHosted() {
     83        public Tree getHosted() {
    8384                return hosted;
    8485        }
    8586
    8687        @AutoAppendAnnotation
    87         public void setHosted(Instance hosted) {
     88        public void setHosted(Tree hosted) {
    8889                if (this.hosted != null) {
    89                         throw new FramsticksException().msg("hosted instance is already set").arg("current", this.hosted);
     90                        throw new FramsticksException().msg("hosted tree is already set").arg("current", this.hosted);
    9091                }
    9192                this.hosted = hosted;
     
    123124                        return;
    124125                }
    125                 acceptThread.dispatch(new RunAt<Accept>() {
     126                //TODO TEH
     127                acceptThread.dispatch(new RunAt<Accept>(ThrowExceptionHandler.getInstance()) {
    126128                        @Override
    127                         public void run() {
     129                        protected void runAt() {
    128130                                try {
    129131                                        log.debug("accepting");
     
    131133                                        assert socket != null;
    132134                                        log.debug("accepted socket: " + socket.getInetAddress().getHostAddress());
    133                                         hosted.dispatch(new RunAt<Instance>() {
     135                                        hosted.dispatch(new RunAt<Tree>(this) {
    134136                                                @Override
    135                                                 public void run() {
    136                                                         InstanceClient client = new InstanceClient(Server.this, socket);
     137                                                protected void runAt() {
     138                                                        ClientAtServer client = new ClientAtServer(Server.this, socket);
    137139                                                        clients.add(client);
    138140                                                        log.info("client connected: " + client);
     
    148150
    149151        protected void tryBind(int when) {
    150                 acceptThread.dispatch(new Task<Accept>(when) {
     152                acceptThread.dispatch(new Task<Accept>(ThrowExceptionHandler.getInstance(), when) {
    151153                        @Override
    152                         public void run() {
     154                        protected void runAt() {
    153155                                try {
    154156                                        acceptSocket.bind(new InetSocketAddress(port));
Note: See TracChangeset for help on using the changeset viewer.