protected void assertWritable() { Assertions.assertFalse(m_readOnly, "Object is read-only"); }
Assertions.assertFalse(m_responses.containsKey(responseSequenceNo), "ResponseSequenceNo #{} already registered", responseSequenceNo); if (requestSequenceNo != null) { // optional Assertions.assertFalse(m_requestToResponseMap.containsKey(requestSequenceNo), "RequestSequenceNo #{} already registered", requestSequenceNo); Assertions.assertFalse(m_responseToRequestMap.containsKey(responseSequenceNo), "ResponseSequenceNo #{} already registered", responseSequenceNo);
public void releaseConnection(Connection conn) { LOG.debug("release {}", conn); synchronized (m_poolLock) { Assertions.assertFalse(isDestroyed(), "{} not available because destroyed.", getClass().getSimpleName());
protected synchronized SqlConnectionPool getSqlConnectionPool() { Assertions.assertFalse(isDestroyed(), "{} not available because the platform has been shut down.", getClass().getSimpleName()); if (m_pool == null) { m_pool = BEANS.get(SqlConnectionPool.class); m_pool.initialize(getClass().getName(), getJdbcPoolSize(), getJdbcPoolConnectionLifetime(), getJdbcPoolConnectionBusyTimeout()); } return m_pool; }
@Override public void setModal(boolean modal) { Assertions.assertFalse(getDesktop().isShowing(this), "Property 'modal' cannot be changed because Form is already showing [form={}]", this); m_modal.set(modal, true); }
/** * Adds a {@link RunMonitor} to this registry, which will be cancelled upon cancellation of the service request (if * specified), or shutdown of the session (if specified) or platform. * * @param runMonitor * the monitor to be registered. * @param sessionId * the sessionId under which to register the monitor, unless <code>null</code> is provided. * @param requestId * the requestId under which to register the monitor, unless <code>null</code> is provided. * @see #cancelAllBySessionId(String) * @see #cancelAllBySessionIdAndRequestId(String, long) */ public IRegistrationHandle register(final RunMonitor runMonitor, final String sessionId, final Long requestId) { final RegistryEntry entry = new RegistryEntry(runMonitor, sessionId, requestId); synchronized (m_registryLock) { Assertions.assertFalse(m_destroyed, "{} not available because the platform has been shut down.", getClass().getSimpleName()); m_registry.add(entry); } return () -> { synchronized (m_registryLock) { m_registry.remove(entry); } }; }
public Connection leaseConnection(AbstractSqlService service) throws ClassNotFoundException, SQLException { managePool(); synchronized (m_poolLock) { Assertions.assertFalse(isDestroyed(), "{} not available because destroyed.", getClass().getSimpleName());
@Override public void start(String sessionId) { Assertions.assertFalse(m_stopping, "Session cannot be started again"); Assertions.assertNotNull(sessionId, "Session id must not be null"); if (isActive()) { throw new IllegalStateException("session is active"); } m_id = sessionId; interceptLoadSession(); setActive(true); fireSessionChangedEvent(new SessionEvent(this, SessionEvent.TYPE_STARTED)); LOG.info("Client session started [session={}, user={}]", this, getUserId()); }
@Override public void setDisplayHint(int displayHint) { Assertions.assertFalse(getDesktop().isShowing(this), "Property 'displayHint' cannot be changed because Form is already showing [form={}]", this); switch (displayHint) { case DISPLAY_HINT_DIALOG: case DISPLAY_HINT_POPUP_WINDOW: case DISPLAY_HINT_VIEW: { m_displayHint = displayHint; break; } default: { throw new IllegalArgumentException("Unsupported displayHint " + displayHint); } } // Update modality hint if not explicitly set yet. boolean modal = (displayHint == IForm.DISPLAY_HINT_DIALOG); m_modal.set(modal, false); m_displayParent.set(resolveDisplayParent(), false); }
@Override public final void start(String sessionId) { Assertions.assertNotNull(sessionId, "Session id must not be null"); m_id = sessionId; Assertions.assertFalse(isActive(), "Session already started"); assignUserId(); interceptLoadSession(); m_active = true; fireSessionChangedEvent(new SessionEvent(this, SessionEvent.TYPE_STARTED)); LOG.info("Server session started [session={}, user={}]", this, getUserId()); }
@Override public void setDisplayParent(IDisplayParent displayParent) { Assertions.assertFalse(ClientSessionProvider.currentSession().getDesktop().isShowing(this), "Property 'displayParent' cannot be changed because FileChooser is already showing [fileChooser={}]", this); if (displayParent == null) { displayParent = BEANS.get(DisplayParentResolver.class).resolve(this); } m_displayParent = Assertions.assertNotNull(displayParent, "'displayParent' must not be null"); }
@Override public IMessageBox withDisplayParent(IDisplayParent displayParent) { Assertions.assertFalse(ClientSessionProvider.currentSession().getDesktop().isShowing(this), "Property 'displayParent' cannot be changed because message box is already showing [messageBox={}]", this); if (displayParent == null) { displayParent = BEANS.get(DisplayParentResolver.class).resolve(this); } m_displayParent = Assertions.assertNotNull(displayParent, "'displayParent' must not be null"); return this; }
/** * @param value * raw value to parse * @return this instance (useful for method chaining) * @throws AssertionException * if parsing failed or method was called more than once */ public DestinationConfigPropertyParser parse(final String value) { Assertions.assertFalse(m_parsed, "Already parsed"); m_rawValue = value; if (StringUtility.hasText(value)) { final URI uri = getAsUri(value); extractResolveMethod(uri); extractDestinationName(uri); extractParameters(uri); } m_parsed = true; return this; }
assertNotNull(destination, "destination not specified"); assertNotNull(input, "publishInput not specified"); assertFalse(input.isTransactional(), "transactional mode not supported for 'request-reply' communication");