Changeset 5 for src/main


Ignore:
Timestamp:
09/24/19 14:13:25 (5 years ago)
Author:
bart
Message:

Fixed performance issue with some computers

Location:
src/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/geniusweb/partiesserver/websocket/PartiesListSocket.java

    r1 r5  
    4646        private AvailablePartiesRepo repo;
    4747        private SendBuffer outstream;
     48        private static transient String hostport = ""; // cache
    4849
    4950        public PartiesListSocket() {
     
    140141        private String getIpAddressAndPort()
    141142                        throws UnknownHostException, MalformedObjectNameException {
     143                synchronized (hostport) {
     144                        if (hostport.isEmpty()) {
     145                                MBeanServer beanServer = ManagementFactory
     146                                                .getPlatformMBeanServer();
    142147
    143                 MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer();
     148                                Set<ObjectName> objectNames = beanServer.queryNames(
     149                                                new ObjectName("*:type=Connector,*"),
     150                                                Query.match(Query.attr("protocol"),
     151                                                                Query.value("HTTP/1.1")));
    144152
    145                 Set<ObjectName> objectNames = beanServer.queryNames(
    146                                 new ObjectName("*:type=Connector,*"),
    147                                 Query.match(Query.attr("protocol"), Query.value("HTTP/1.1")));
     153                                String host = InetAddress.getLocalHost().getHostAddress();
     154                                String port = objectNames.iterator().next()
     155                                                .getKeyProperty("port");
    148156
    149                 String host = InetAddress.getLocalHost().getHostAddress();
    150                 String port = objectNames.iterator().next().getKeyProperty("port");
    151 
    152                 return host + ":" + port;
     157                                hostport = host + ":" + port;
     158                        }
     159                        return hostport;
     160                }
    153161
    154162        }
  • src/main/webapp/index.jsp

    r2 r5  
    1818        Notice that these may contain files
    1919        with errors, and thus are not available for use (and not appear on the parties list).
    20 
    21         <h2>Adding / Removing party classes</h2>
    22         You can add and remove parties by dragging your jar files into and
    23         out of the <code>partiesserver/partiesrepo</code> directory. This directory is inside the
    24         tomcat directory which is created when the partiesserver is
    25         started the first time. Changed, new or removed files are recognised automatically by the server and made available.
    26         Be careful when you change this as this may disturb currently running sessions and tournaments.
    27         <br>
    28         For making or compiling new parties, please refer to the <a href="https://tracinsy.ewi.tudelft.nl/pubtrac/GeniusWeb"> GeniusWeb main page</a>.
     20<p>
     21        For help and more info, please refer to the <a href="https://tracinsy.ewi.tudelft.nl/pubtrac/GeniusWebPartiesServer"> parties server page</a>.
    2922       
    3023
Note: See TracChangeset for help on using the changeset viewer.