Codota Logo
KernelException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.jme3.network.kernel.KernelException
constructor

Best Java code snippets using com.jme3.network.kernel.KernelException.<init> (Showing top 20 results out of 315)

  • Common ways to obtain KernelException
private void myMethod () {
KernelException k =
  • Codota IconString str;new KernelException(str)
  • Codota IconString str;Throwable cause;new KernelException(str, cause)
  • Codota IconThrowable cause;new KernelException("Error sending datagram to:" + address, cause)
  • Smart code suggestions by Codota
}
origin: jMonkeyEngine/jmonkeyengine

  protected void addEnvelope( Envelope env )
  {
    if( !envelopes.offer( env ) ) {
      throw new KernelException( "Critical error, could not enqueue envelope." );
    }            
  }
}
origin: jMonkeyEngine/jmonkeyengine

public void send( ByteBuffer data )
{   
  if( data == null ) {
    throw new IllegalArgumentException( "Data cannot be null." );
  }
  if( closing ) {
    throw new KernelException( "Endpoint has been closed:" + socket );
  }
  send( data, true, true );
}
origin: jMonkeyEngine/jmonkeyengine

public void send( ByteBuffer data )
{
  if( !isConnected() ) {
    throw new KernelException( "Endpoint is not connected:" + this );
  }
  
  
  try {
    DatagramPacket p = new DatagramPacket( data.array(), data.position(), 
                        data.remaining(), address );
                            // Just queue it up for the kernel threads to write
    // out
    kernel.enqueueWrite( this, p );
                                  //socket.send(p);
  } catch (Exception e) {
    if (e instanceof SocketException) {
      throw new KernelException("Error sending datagram to:" + address, e);
    } else if (e instanceof RuntimeException) {
      throw (RuntimeException) e;
    } else {
      throw new RuntimeException(e);
    }
  }
}
origin: jMonkeyEngine/jmonkeyengine

public void terminate() throws InterruptedException
{
  if( thread == null )
    throw new IllegalStateException( "Kernel not initialized." );
  try {
    thread.close();
    writer.shutdown();
    thread = null;
    
    // Need to let any caller waiting for a read() wakeup 
    wakeupReader();       
  } catch( IOException e ) {
    throw new KernelException( "Error closing host connection:" + address, e );
  }
}
origin: jMonkeyEngine/jmonkeyengine

  public void run()
  {
    log.log( Level.FINE, "Kernel started for connection:{0}.", address );
    // An atomic is safest and costs almost nothing
    while( go.get() ) {
      // Setup any queued option changes
      setupSelectorOptions();
      // Check for available keys and process them
      try {
        select();                    
      } catch( ClosedSelectorException e ) {
        if( !go.get() )
          return;  // it's because we're shutting down
        throw new KernelException( "Premature selector closing", e );
      } catch( CancelledKeyException e ) {
        if( !go.get() )
          return;  // it's because we're shutting down
        throw new KernelException( "Invalid key state", e );
      } catch( IOException e ) {
        if( !go.get() )
          return;  // error likely due to shutting down
        reportError( e );
      }
    }
  }
}
origin: jMonkeyEngine/jmonkeyengine

public void terminate() throws InterruptedException
{
  if( thread == null )
    throw new IllegalStateException( "Kernel not initialized." );
  try {
    thread.close();
    thread = null;
    
    // Need to let any caller waiting for a read() wakeup 
    wakeupReader();       
  } catch( IOException e ) {
    throw new KernelException( "Error closing host connection:" + address, e );
  }
}
origin: jMonkeyEngine/jmonkeyengine

public void close( boolean flush )
{
  // No real reason to flush UDP traffic yet... especially
  // when considering that the outbound UDP isn't even
  // queued.

  try {
    kernel.closeEndpoint(this);
    connected = false;
  } catch( IOException e ) {
    throw new KernelException( "Error closing endpoint for socket:" + socket, e );
  }
}
origin: jMonkeyEngine/jmonkeyengine

public void initialize()
{
  if( thread != null )
    throw new IllegalStateException( "Kernel already initialized." );
  writer = Executors.newFixedThreadPool(2, new NamedThreadFactory(toString() + "-writer"));
  
  thread = createHostThread();
  try {
    thread.connect();
    thread.start();
  } catch( IOException e ) {
    throw new KernelException( "Error hosting:" + address, e );
  }
}
origin: jMonkeyEngine/jmonkeyengine

public void initialize()
{
  if( thread != null )
    throw new IllegalStateException( "Kernel already initialized." );
  thread = createSelectorThread();
  try {
    thread.connect();
    thread.start();
  } catch( IOException e ) {
    throw new KernelException( "Error hosting:" + address, e );
  }
}
origin: jMonkeyEngine/jmonkeyengine

public void close( boolean flushData )
{
  if( flushData ) {
    closing = true;
    
    // Enqueue a close marker message to let the server
    // know we should close
    send( CLOSE_MARKER, false, true );
    
    return;
  }

  try {
    // Note: even though we may be disconnected from the socket.isConnected()
    // standpoint, it's still safest to tell the kernel so that it can be sure
    // to stop managing us gracefully.
    kernel.closeEndpoint(this);
  } catch( IOException e ) {
    throw new KernelException( "Error closing endpoint for socket:" + socket, e );
  }
}
origin: jMonkeyEngine/jmonkeyengine

  public void run()
  {
    // Not guaranteed to always work but an extra datagram
    // to a dead connection isn't so big of a deal.
    if( !endpoint.isConnected() ) {
      return;
    }
    
    try {
      thread.getSocket().send(packet);
    } catch( Exception e ) {
      KernelException exc = new KernelException( "Error sending datagram to:" + address, e );
      exc.fillInStackTrace();
      reportError(exc);
    }
  } 
}
origin: org.jmonkeyengine/jme3-networking

  protected void addEnvelope( Envelope env )
  {
    if( !envelopes.offer( env ) ) {
      throw new KernelException( "Critical error, could not enqueue envelope." );
    }            
  }
}
origin: info.projectkyoto/mms-engine

  protected void addEnvelope( Envelope env )
  {
    if( !envelopes.offer( env ) ) {
      throw new KernelException( "Critical error, could not enqueue envelope." );
    }            
  }
}
origin: info.projectkyoto/mms-engine

public void terminate() throws InterruptedException
{
  if( thread == null )
    throw new IllegalStateException( "Kernel not initialized." );
  try {
    thread.close();
    thread = null;
  } catch( IOException e ) {
    throw new KernelException( "Error closing host connection:" + address, e );
  }
}
origin: info.projectkyoto/mms-engine

public void terminate() throws InterruptedException
{
  if( thread == null )
    throw new IllegalStateException( "Kernel not initialized." );
  try {
    thread.close();
    writer.shutdown();
    thread = null;
  } catch( IOException e ) {
    throw new KernelException( "Error closing host connection:" + address, e );
  }
}
origin: info.projectkyoto/mms-engine

public void send( ByteBuffer data )
{   
  if( data == null ) {
    throw new IllegalArgumentException( "Data cannot be null." );
  }
  if( closing ) {
    throw new KernelException( "Endpoint has been closed:" + socket );
  }
  send( data, true, true );
}
origin: org.jmonkeyengine/jme3-networking

public void send( ByteBuffer data )
{   
  if( data == null ) {
    throw new IllegalArgumentException( "Data cannot be null." );
  }
  if( closing ) {
    throw new KernelException( "Endpoint has been closed:" + socket );
  }
  send( data, true, true );
}
origin: org.jmonkeyengine/jme3-networking

public void close( boolean flush )
{
  // No real reason to flush UDP traffic yet... especially
  // when considering that the outbound UDP isn't even
  // queued.

  try {
    kernel.closeEndpoint(this);
    connected = false;
  } catch( IOException e ) {
    throw new KernelException( "Error closing endpoint for socket:" + socket, e );
  }
}
origin: info.projectkyoto/mms-engine

public void close( boolean flush )
{
  // No real reason to flush UDP traffic yet... especially
  // when considering that the outbound UDP isn't even
  // queued.

  try {
    kernel.closeEndpoint(this);
    connected = false;
  } catch( IOException e ) {
    throw new KernelException( "Error closing endpoint for socket:" + socket, e );
  }
}
origin: org.jmonkeyengine/jme3-networking

public void initialize()
{
  if( thread != null )
    throw new IllegalStateException( "Kernel already initialized." );
  thread = createSelectorThread();
  try {
    thread.connect();
    thread.start();
  } catch( IOException e ) {
    throw new KernelException( "Error hosting:" + address, e );
  }
}
com.jme3.network.kernelKernelException<init>

Popular methods of KernelException

  • fillInStackTrace

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now