private void ensureNotInitialized() { ensureThatState(initialized, is(false)); }
private void ensureInitialized() { ensureThatState(initialized, is(true)); }
public void init() { ensureThatState(specificationLoader, is(notNullValue())); }
public FacetProcessor( final NakedObjectConfiguration configuration, final SpecificationLoader specificationLoader, final CollectionTypeRegistry collectionTypeRegistry, final ProgrammingModelFacets programmingModelFacets) { ensureThatState(configuration, is(notNullValue())); ensureThatState(collectionTypeRegistry, is(notNullValue())); ensureThatState(programmingModelFacets, is(notNullValue())); ensureThatState(specificationLoader, is(notNullValue())); this.configuration = configuration; this.specificationLoader = specificationLoader; this.programmingModelFacets = programmingModelFacets; this.collectionTypeRegistry = collectionTypeRegistry; }
public void init() { ensureThatState(specificationLoader, is(notNullValue())); }
public FacetProcessor( final NakedObjectConfiguration configuration, final SpecificationLoader specificationLoader, final CollectionTypeRegistry collectionTypeRegistry, final ProgrammingModelFacets programmingModelFacets) { ensureThatState(configuration, is(notNullValue())); ensureThatState(collectionTypeRegistry, is(notNullValue())); ensureThatState(programmingModelFacets, is(notNullValue())); ensureThatState(specificationLoader, is(notNullValue())); this.configuration = configuration; this.specificationLoader = specificationLoader; this.programmingModelFacets = programmingModelFacets; this.collectionTypeRegistry = collectionTypeRegistry; }
public void init() { ensureThatState(specificationLoader, is(notNullValue())); }
protected void ensureDependenciesInjected() { Ensure.ensureThatState(installerLookup, is(not(nullValue()))); Ensure.ensureThatState(configurationBuilder, is(not(nullValue()))); }
public void open() { ensureThatState(session, is(notNullValue()), "session is required"); }
public void init() { ensureThatState(specificationLoader, is(notNullValue())); }
private void ensureDependenciesInjected() { Ensure.ensureThatState(configurationBuilder, is(not(nullValue()))); }
public void open() { ensureThatState(adapterFactory, is(notNullValue())); ensureThatState(specificationLoader, is(notNullValue())); ensureThatState(oidGenerator, is(notNullValue())); ensureThatState(servicesInjector, is(notNullValue())); if (oidAdapterMap == null) { oidAdapterMap = new OidAdapterHashMap(); } if (pojoAdapterMap == null) { pojoAdapterMap = new PojoAdapterHashMap(); } oidAdapterMap.open(); pojoAdapterMap.open(); }
public final void init() { // check prereq dependencies injected ensureThatState(specificationLoader, is(notNullValue())); ensureThatState(serviceList, is(notNullValue())); // a bit of a workaround, but required if anything in the metamodel (for example, a // ValueSemanticsProvider for a date value type) needs to use the Clock singleton // we do this after loading the services to allow a service to prime a different clock // implementation (eg to use an NTP time service). if (!deploymentType.isProduction() && !Clock.isInitialized()) { FixtureClock.initialize(); } doInit(); }
@Override protected List<Object> obtainServices() { if (servicesInstaller == null) { servicesInstaller = installerLookup.servicesInstaller(null); } ensureThatState(servicesInstaller, is(not(nullValue())), "services installer has not been injected and could not be looked up"); return servicesInstaller.getServices(getDeploymentType()); }
public void init() { ensureThatState(runtimeContext, is(notNullValue())); programmingModelFacets.init(); final List<FacetFactory> facetFactoryList = programmingModelFacets.getList(); for (final FacetFactory facetFactory : facetFactoryList) { registerFactory(facetFactory); } }
public void init() { ensureThatState(runtimeContext, is(notNullValue())); programmingModelFacets.init(); final List<FacetFactory> facetFactoryList = programmingModelFacets.getList(); for (final FacetFactory facetFactory : facetFactoryList) { registerFactory(facetFactory); } }
protected void ensureTransactionNotInProgress() { ensureThatState( getTransaction() != null && !getTransaction().getState().isComplete(), is(false), "Transaction in progress"); }
protected void ensureTransactionInProgress() { ensureThatState( getTransaction() != null && !getTransaction().getState().isComplete(), is(true), "No transaction in progress"); }
public final void flush() { ensureThatState(getState().canFlush(), is(true), "state is: " + getState()); if (LOG.isInfoEnabled()) { LOG.info("flush transaction " + this); } try { doFlush(); } catch(RuntimeException ex) { setState(State.MUST_ABORT); setAbortCause(ex); throw ex; } }
public final void abort() { ensureThatState(getState().canAbort(), is(true), "state is: " + getState()); if (LOG.isInfoEnabled()) { LOG.info("abort transaction " + this); } try { doAbort(); } catch(RuntimeException ex) { setAbortCause(ex); throw ex; } finally { setState(State.ABORTED); } }