Package com.sun.sgs.impl.service.session

Examples of com.sun.sgs.impl.service.session.ClientSessionServiceImpl$ContextFactory


    {
        final ContextFactoryMapper contextFactoryMapper = ContextFactoryMapper.getFactory() ;
        try
        {
            final String coordinationType = createCoordinationContext.getCoordinationType() ;
            final ContextFactory contextFactory = contextFactoryMapper.getContextFactory(coordinationType) ;
           
            if (contextFactory != null)
            {
                final CoordinationContext coordinationContext ;
                try
                {
                    final Expires expiresElement = createCoordinationContext.getExpires() ;
                    final Long expires = (expiresElement == null ? null : new Long(expiresElement.getValue())) ;
                   
                    coordinationContext = contextFactory.create(coordinationType, expires, createCoordinationContext.getCurrentContext(), isSecure) ;
                    final CreateCoordinationContextResponseType response = new CreateCoordinationContextResponseType() ;
                    response.setCoordinationContext(coordinationContext) ;
                    return response;
                }
                catch (final InvalidCreateParametersException invalidCreateParametersException)
View Full Code Here


  public void removeContextFactory (String coordinationTypeURI)
  {
    try
    {
      ContextFactory contextFactory = (ContextFactory) _protocols.removeProtocol(convert(coordinationTypeURI));

      contextFactory.uninstall(coordinationTypeURI);
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
View Full Code Here

                if (type instanceof String)
                {
                    Class c = Class.forName((String) type);

                    ContextFactory factory = (ContextFactory) c.newInstance();

                    _protocols.replaceProtocol(doc, factory);

                    return factory;
                }
View Full Code Here

    {
        final ContextFactoryMapper contextFactoryMapper = ContextFactoryMapper.getFactory() ;
        try
        {
            final String coordinationType = createCoordinationContext.getCoordinationType() ;
            final ContextFactory contextFactory = contextFactoryMapper.getContextFactory(coordinationType) ;
           
            if (contextFactory != null)
            {
                final CoordinationContext coordinationContext ;
                try
                {
                    final Expires expiresElement = createCoordinationContext.getExpires() ;
                    final Long expires = (expiresElement == null ? null : new Long(expiresElement.getValue())) ;
                   
                    coordinationContext = contextFactory.create(coordinationType, expires, createCoordinationContext.getCurrentContext(), isSecure) ;
                    final CreateCoordinationContextResponseType response = new CreateCoordinationContextResponseType() ;
                    response.setCoordinationContext(coordinationContext) ;
                    return response;
                }
                catch (final InvalidCreateParametersException invalidCreateParametersException)
View Full Code Here

    // -- Test constructor --

    @Test
    public void testConstructorNullProperties() throws Exception {
  try {
      new ClientSessionServiceImpl(
    null, serverNode.getSystemRegistry(),
    serverNode.getProxy());
      fail("Expected NullPointerException");
  } catch (NullPointerException e) {
      System.err.println(e);
View Full Code Here

    }

    @Test
    public void testConstructorNullComponentRegistry() throws Exception {
  try {
      new ClientSessionServiceImpl(serviceProps, null,
           serverNode.getProxy());
      fail("Expected NullPointerException");
  } catch (NullPointerException e) {
      System.err.println(e);
  }
View Full Code Here

    }

    @Test
    public void testConstructorNullTransactionProxy() throws Exception {
  try {
      new ClientSessionServiceImpl(serviceProps,
           serverNode.getSystemRegistry(), null);
      fail("Expected NullPointerException");
  } catch (NullPointerException e) {
      System.err.println(e);
  }
View Full Code Here

    }

    @Test
    public void testConstructorNoAppName() throws Exception {
  try {
      new ClientSessionServiceImpl(
    new Properties(), serverNode.getSystemRegistry(),
    serverNode.getProxy());
      fail("Expected IllegalArgumentException");
  } catch (IllegalArgumentException e) {
      System.err.println(e);
View Full Code Here

    @Test
    public void testConstructorNoPort() throws Exception {
        Properties props =
            createProperties(StandardProperties.APP_NAME, APP_NAME);
        new ClientSessionServiceImpl(
            props, serverNode.getSystemRegistry(),
            serverNode.getProxy());
    }
View Full Code Here

  try {
      Properties props =
    createProperties(
        StandardProperties.APP_NAME, APP_NAME,
                    SimpleSgsProtocolAcceptor.DISCONNECT_DELAY_PROPERTY, "199");
      new ClientSessionServiceImpl(
    props, serverNode.getSystemRegistry(),
    serverNode.getProxy());
      fail("Expected IllegalArgumentException");
  } catch (IllegalArgumentException e) {
      System.err.println(e);
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.service.session.ClientSessionServiceImpl$ContextFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.