org.apache.polygene.api.identity.Identity类的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(139)

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

Identity介绍

[英]Representation of an Identity. Identity is an opaque, immutable data type. Identity is a very central concept in any domain model.
[中]身份的表示。标识是一种不透明、不可变的数据类型。身份在任何领域模型中都是一个非常核心的概念。

代码示例

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

@Override
  public String toString()
  {
    return identity.toString();
  }
}

代码示例来源:origin: org.apache.polygene.extensions/org.apache.polygene.extension.entitystore-jdbm

private Long getStateIndex( Identity identity )
  throws IOException
{
  return (Long) index.find( identity.toBytes() );
}

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

public void setIdentity( Identity identity )
{
  if( identity == null )
  {
    return;
  }
  this.identity = identity.toString();
}

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

private Long getStateIndex( Identity identity )
  throws IOException
{
  return (Long) index.find( identity.toBytes() );
}

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

public void setIdentity( Identity identity )
{
  if( identity == null )
  {
    return;
  }
  this.identity = identity.toString();
}

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

@Override
  public String toString()
  {
    return identity.toString();
  }
}

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

@Override
public String extractName( Identity identity )
{
  String idString = identity.toString();
  int pos = idString.indexOf( SEPARATOR );
  if( pos < 1 )
  {
    throw new InvalidIdentityFormatException( idString );
  }
  return idString.substring( pos + 1 );
}

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

public static Predicate<ServiceReference<?>> withId( final String anId )
{
  return service -> service.identity().toString().equals( anId );
}

代码示例来源:origin: org.apache.polygene.libraries/org.apache.polygene.library.jmx

public String getId()
{
  return serviceDescriptor.identity().toString();
}

代码示例来源:origin: org.apache.polygene.libraries/org.apache.polygene.library.jmx

public String getId()
{
  return serviceDescriptor.identity().toString();
}

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

public static Predicate<ServiceReference<?>> withId( final String anId )
{
  return service -> service.identity().toString().equals( anId );
}

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

public String getId()
{
  return serviceDescriptor.identity().toString();
}

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

public String getId()
{
  return serviceDescriptor.identity().toString();
}

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

public AbstractSQLIndexQueryAssembler()
{
  identifiedBy( DEFAULT_IDENTITY.toString() );
}

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

@Override
  public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
    throws EntityNotFoundException
  {
    String jsonState = jedis.get( ref.identity().toString() );
    if( notFound( jsonState ) )
    {
      throw new EntityNotFoundException( ref );
    }
    jedis.del( ref.identity().toString() );
  }
} );

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

private void removeEntity( EntityState state, PreparedStatement ps )
  throws SQLException
{
  ps.setString( 1, state.entityReference().identity().toString() );
  ps.addBatch();
}

代码示例来源:origin: org.apache.polygene.extensions/org.apache.polygene.extension.entitystore-jdbm

private File createTemporaryDatabase()
{
  try
  {
    File tempDatabase = Files.createTempFile( getTemporaryDirectory().toPath(),
                         descriptor.identity().toString(),
                         "write" ).toFile();
    tempDatabase.deleteOnExit();
    return tempDatabase;
  }
  catch( IOException ex )
  {
    throw new UncheckedIOException( ex );
  }
}

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

private File createTemporaryDatabase()
{
  try
  {
    File tempDatabase = Files.createTempFile( getTemporaryDirectory().toPath(),
                         descriptor.identity().toString(),
                         "write" ).toFile();
    tempDatabase.deleteOnExit();
    return tempDatabase;
  }
  catch( IOException ex )
  {
    throw new UncheckedIOException( ex );
  }
}

代码示例来源:origin: org.apache.polygene.extensions/org.apache.polygene.extension.entitystore-jdbm

private File getTemporaryDirectory() throws IOException
{
  if( tempDirectory != null )
  {
    return tempDirectory;
  }
  String storeId = descriptor.identity().toString();
  tempDirectory = fileConfiguration != null
          ? new File( fileConfiguration.temporaryDirectory(), storeId )
          : new File( new File( System.getProperty( "java.io.tmpdir" ) ),
                storeId );
  if( !tempDirectory.exists() )
  {
    java.nio.file.Files.createDirectories( tempDirectory.toPath() );
  }
  return tempDirectory;
}

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

private File getTemporaryDirectory() throws IOException
{
  if( tempDirectory != null )
  {
    return tempDirectory;
  }
  String storeId = descriptor.identity().toString();
  tempDirectory = fileConfiguration != null
          ? new File( fileConfiguration.temporaryDirectory(), storeId )
          : new File( new File( System.getProperty( "java.io.tmpdir" ) ),
                storeId );
  if( !tempDirectory.exists() )
  {
    java.nio.file.Files.createDirectories( tempDirectory.toPath() );
  }
  return tempDirectory;
}

相关文章