org.apache.polygene.api.structure.Application.version()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.apache.polygene.api.structure.Application.version()方法的一些代码示例,展示了Application.version()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.version()方法的具体详情如下:
包路径:org.apache.polygene.api.structure.Application
类名称:Application
方法名:version

Application.version介绍

[英]The version of the application. This can be in any format, but most likely will follow the Dewey format, i.e. x.y.z.
[中]应用程序的版本。这可以是任何格式,但最有可能遵循杜威格式,即x.y.z。

代码示例

代码示例来源:origin: apache/attic-polygene-java

@Override
public void activateService()
  throws IOException
{
  File tmp;
  if( fileConfig == null )
  {
    tmp = new File( "polygene", app.name() + "-" + app.version() );
  }
  else
  {
    tmp = fileConfig.temporaryDirectory();
  }
  workDir = new File( tmp, "uowfile-" + me.identity().get() );
  if( !workDir.exists() && !workDir.mkdirs() )
  {
    throw new IOException( "Unable to create temporary directory: " + workDir );
  }
}

代码示例来源:origin: apache/attic-polygene-java

@SuppressWarnings( "SameParameterValue" )
protected void addEntityInfoToInsertToEntityTablePS( EntityState state, PreparedStatement ps, int startingIndex )
  throws SQLException
{
  ps.setString( startingIndex, state.entityReference().identity().toString() );
  ps.setTimestamp( startingIndex + 1, Timestamp.from( state.lastModified() ) );
  ps.setString( startingIndex + 2, state.version() );
  ps.setString( startingIndex + 3, this._app.version() );
}

代码示例来源:origin: apache/attic-polygene-java

private void updateEntityInfoAndProperties( Connection connection,
                      Map<QualifiedName, PreparedStatement> qNameInsertPSs,
                      PreparedStatement insertAllQNamesPS,
                      PreparedStatement clearPropertiesPS,
                      PreparedStatement ps,
                      EntityState state,
                      Long entityPK,
                      Map<Long, Integer> qNamePKs
                     )
  throws SQLException
{
  this.clearAllEntitysQNames( clearPropertiesPS, entityPK );
  // Update state
  ps.setString( 1, state.entityReference().identity().toString() );
  ps.setTimestamp( 2, Timestamp.from( state.lastModified() ) );
  ps.setString( 3, state.version() );
  ps.setString( 4, this._app.version() );
  ps.setLong( 5, entityPK );
  ps.addBatch();
  Integer nextUsableQNamePK = this.insertPropertyQNames( connection, qNameInsertPSs, insertAllQNamesPS,
                              state, entityPK );
  qNamePKs.put( entityPK, nextUsableQNamePK );
}

代码示例来源:origin: apache/attic-polygene-java

@Override
public EntityState newEntityState( EntityStoreUnitOfWork uow,
                  EntityReference reference,
                  EntityDescriptor entityDescriptor
)
{
  try
  {
    JsonObjectBuilder builder = jsonFactories.builderFactory().createObjectBuilder();
    builder.add( JSONKeys.IDENTITY, reference.identity().toString() );
    builder.add( JSONKeys.APPLICATION_VERSION, application.version() );
    builder.add( JSONKeys.TYPE, entityDescriptor.types().findFirst().get().getName() );
    builder.add( JSONKeys.VERSION, uow.identity().toString() );
    builder.add( JSONKeys.MODIFIED, uow.currentTime().toEpochMilli() );
    builder.add( JSONKeys.VALUE, jsonFactories.builderFactory().createObjectBuilder().build() );
    JsonObject state = builder.build();
    return new JSONEntityState( entityDescriptor.module(), serialization, jsonFactories,
                  uow.identity().toString(), uow.currentTime(),
                  reference,
                  EntityStatus.NEW, entityDescriptor,
                  state );
  }
  catch( Exception e )
  {
    throw new EntityStoreException( e );
  }
}

代码示例来源:origin: org.apache.polygene.core/org.apache.polygene.core.spi

@Override
public EntityState newEntityState( EntityStoreUnitOfWork uow,
                  EntityReference reference,
                  EntityDescriptor entityDescriptor
)
{
  try
  {
    JsonObjectBuilder builder = jsonFactories.builderFactory().createObjectBuilder();
    builder.add( JSONKeys.IDENTITY, reference.identity().toString() );
    builder.add( JSONKeys.APPLICATION_VERSION, application.version() );
    builder.add( JSONKeys.TYPE, entityDescriptor.types().findFirst().get().getName() );
    builder.add( JSONKeys.VERSION, uow.identity().toString() );
    builder.add( JSONKeys.MODIFIED, uow.currentTime().toEpochMilli() );
    builder.add( JSONKeys.VALUE, jsonFactories.builderFactory().createObjectBuilder().build() );
    JsonObject state = builder.build();
    return new JSONEntityState( entityDescriptor.module(), serialization, jsonFactories,
                  uow.identity().toString(), uow.currentTime(),
                  reference,
                  EntityStatus.NEW, entityDescriptor,
                  state );
  }
  catch( Exception e )
  {
    throw new EntityStoreException( e );
  }
}

代码示例来源:origin: apache/attic-polygene-java

String version = app.version();
String lastVersion = config.get().lastStartupVersion().get();
if( !app.version().equals( lastVersion ) )

代码示例来源:origin: apache/attic-polygene-java

String appVersion = application.version();
String type = entityState.entityDescriptor().primaryType().getName();
Usecase usecase = unitOfWork.usecase();

代码示例来源:origin: org.apache.polygene.core/org.apache.polygene.core.spi

json.add( JSONKeys.APPLICATION_VERSION, application.version() );
json.add( JSONKeys.TYPE, state.entityDescriptor().primaryType().getName() );
json.add( JSONKeys.VERSION, version );

代码示例来源:origin: apache/attic-polygene-java

if( currentAppVersion.equals( application.version() ) )
    state = migration.migrate( jsonStateBuilder.build(), application.version(), this );
    jsonStateBuilder.add( JSONKeys.APPLICATION_VERSION, application.version() );
    state = jsonStateBuilder.build();

代码示例来源:origin: apache/attic-polygene-java

json.add( JSONKeys.APPLICATION_VERSION, application.version() );
json.add( JSONKeys.TYPE, state.entityDescriptor().primaryType().getName() );
json.add( JSONKeys.VERSION, version );

代码示例来源:origin: org.apache.polygene.core/org.apache.polygene.core.spi

if( currentAppVersion.equals( application.version() ) )
    state = migration.migrate( jsonStateBuilder.build(), application.version(), this );
    jsonStateBuilder.add( JSONKeys.APPLICATION_VERSION, application.version() );
    state = jsonStateBuilder.build();

代码示例来源:origin: apache/attic-polygene-java

String appVersion = this._app.version();
String dbAppVersion = this.readAppVersionFromDB( connection, schemaName );

代码示例来源:origin: apache/attic-polygene-java

if( !currentAppVersion.equals( application.version() ) )
    migration.migrate( row, application.version(), cluster.cassandraClientSession() );

代码示例来源:origin: org.apache.polygene.core/org.apache.polygene.core.spi

if( currentAppVersion.equals( application.version() ) )
    state = migration.migrate( jsonStateBuilder.build(), application.version(), this );
    jsonStateBuilder.add( JSONKeys.APPLICATION_VERSION, application.version() );
    state = jsonStateBuilder.build();

代码示例来源:origin: apache/attic-polygene-java

prototype.version().set( application.version() );
prototype.timestamp().set( unitOfWork.currentTime() );
prototype.context().set( proxy.getClass().getSuperclass().getName().split( "\\$" )[ 0 ] );

代码示例来源:origin: apache/attic-polygene-java

if( currentAppVersion.equals( application.version() ) )
    state = migration.migrate( jsonStateBuilder.build(), application.version(), this );
    jsonStateBuilder.add( JSONKeys.APPLICATION_VERSION, application.version() );
    state = jsonStateBuilder.build();

代码示例来源:origin: apache/attic-polygene-java

prototype.version().set( application.version() );
prototype.timestamp().set( unitOfWork.currentTime() );
prototype.context().set( proxy.getClass().getSuperclass().getName().split( "\\$" )[ 0 ] );

代码示例来源:origin: apache/attic-polygene-java

@Test
  public void validateThatAssemblerCreatesApplication()
    throws AssemblyException, ActivationException
  {
    TestApplication assembler = new TestApplication( "Test Application", "1.0.1", Application.Mode.test );
    assembler.initialize();
    assembler.start();

    assertThat( assembler.application().name(), equalTo("Test Application") );
    assertThat( assembler.application().version(), equalTo("1.0.1") );
  }
}

代码示例来源:origin: apache/attic-polygene-java

ps.setString( 1, this._app.version() );
ps.execute();

相关文章