$darkmode
DENOPTIM
denoptim.integration.python.Py4JGetawayServer Class Reference

A tool that start a Py4J gateway server that can listens to calls from Python and translate JAVA objects to make their functionality available to in the Python environment. More...

Collaboration diagram for denoptim.integration.python.Py4JGetawayServer:
[legend]

Public Member Functions

Object loadData (String pathname) throws Exception
 Reads any DENOPTIM-kind of data from the given pathname. More...
 
Object getData ()
 
String getSourcePathName ()
 
void shutdown ()
 Stops the server. More...
 

Static Public Member Functions

static void launch () throws DENOPTIMException
 Starts a gateway server using this class as entry point, which then becomes the interpreter of any data fed-in by the loadData(String) method. More...
 

Private Member Functions

void setServer (GatewayServer server)
 Sets the reference to the launched server. More...
 

Private Attributes

GatewayServer server
 The actual server we launch, or null if not launched yet. More...
 
String pathname = null
 Pathname from which data was loaded, or null if no data has been loaded. More...
 
Object data = null
 Any DENOPTIM-related data loaded from file, if any. More...
 

Detailed Description

A tool that start a Py4J gateway server that can listens to calls from Python and translate JAVA objects to make their functionality available to in the Python environment.

Author
Marco Foscato

Definition at line 35 of file Py4JGetawayServer.java.

Member Function Documentation

◆ getData()

Object denoptim.integration.python.Py4JGetawayServer.getData ( )
Returns
the current value of the loaded data, if any.

Definition at line 97 of file Py4JGetawayServer.java.

References denoptim.integration.python.Py4JGetawayServer.data.

◆ getSourcePathName()

String denoptim.integration.python.Py4JGetawayServer.getSourcePathName ( )
Returns
the pathname from which data was imported, or null if no data has been loaded yet.

Definition at line 108 of file Py4JGetawayServer.java.

References denoptim.integration.python.Py4JGetawayServer.pathname.

◆ launch()

static void denoptim.integration.python.Py4JGetawayServer.launch ( ) throws DENOPTIMException
static

Starts a gateway server using this class as entry point, which then becomes the interpreter of any data fed-in by the loadData(String) method.

Exceptions
DENOPTIMException

Definition at line 60 of file Py4JGetawayServer.java.

References denoptim.integration.python.Py4JGetawayServer.setServer().

Referenced by denoptim.main.Main.main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadData()

Object denoptim.integration.python.Py4JGetawayServer.loadData ( String  pathname) throws Exception

Reads any DENOPTIM-kind of data from the given pathname.

Parameters
pathnamethe pathname of the file to read.
Returns
the data found in the file.
Exceptions
Exceptionif anything goes wrong with the reading of the data.

Definition at line 85 of file Py4JGetawayServer.java.

References denoptim.integration.python.Py4JGetawayServer.data, denoptim.integration.python.Py4JGetawayServer.pathname, and denoptim.io.DenoptimIO.readDENOPTIMData().

Here is the call graph for this function:

◆ setServer()

void denoptim.integration.python.Py4JGetawayServer.setServer ( GatewayServer  server)
private

Sets the reference to the launched server.

Parameters
server

Definition at line 130 of file Py4JGetawayServer.java.

References denoptim.integration.python.Py4JGetawayServer.server.

Referenced by denoptim.integration.python.Py4JGetawayServer.launch().

Here is the caller graph for this function:

◆ shutdown()

void denoptim.integration.python.Py4JGetawayServer.shutdown ( )

Stops the server.

Definition at line 118 of file Py4JGetawayServer.java.

References denoptim.integration.python.Py4JGetawayServer.server.

Member Data Documentation

◆ data

Object denoptim.integration.python.Py4JGetawayServer.data = null
private

Any DENOPTIM-related data loaded from file, if any.

Definition at line 50 of file Py4JGetawayServer.java.

Referenced by denoptim.integration.python.Py4JGetawayServer.getData(), and denoptim.integration.python.Py4JGetawayServer.loadData().

◆ pathname

String denoptim.integration.python.Py4JGetawayServer.pathname = null
private

Pathname from which data was loaded, or null if no data has been loaded.

Definition at line 45 of file Py4JGetawayServer.java.

Referenced by denoptim.integration.python.Py4JGetawayServer.getSourcePathName(), and denoptim.integration.python.Py4JGetawayServer.loadData().

◆ server

GatewayServer denoptim.integration.python.Py4JGetawayServer.server
private

The actual server we launch, or null if not launched yet.

Definition at line 40 of file Py4JGetawayServer.java.

Referenced by denoptim.integration.python.Py4JGetawayServer.setServer(), and denoptim.integration.python.Py4JGetawayServer.shutdown().


The documentation for this class was generated from the following file: