Code example for Cache

Methods: get

0
 
        final Integer windowID = Integer.valueOf(windowId);
        final DisplaySurfaceHandle resourceHandle = new XWindowHandle(windowID);
        XWindow window = null;
        try { 
            window = this.xWindows.get(Integer.valueOf(windowId),
                    new Callable<XWindow>() {
                        @Override 
                        public XWindow call() { 
                            LOG.debug("Xwindow={} added to cache.", 
                                    windowId);
 
                            final XWindow xWindow = (XWindow) XWindowCacheImpl.this.displaySurfaceFactory
                                    .createDisplaySurface(resourceHandle);
                            xWindow.register(new DestroyListener(xWindow));
                            return xWindow;
                        } 
                    }); 
        } catch (final ExecutionException e) {
            Throwables.propagate(e);