asphalt.py4j.component¶
-
class
asphalt.py4j.component.Py4JComponent(gateways: typing.Dict[str, typing.Dict[str, typing.Any]] = None, **default_gateway_args)¶ Bases:
asphalt.core.component.ComponentCreates one or more
JavaGatewayresources.If
gatewaysis given, a Java gateway resource will be published for each key in the dictionary, using the key as the resource name. Any extra keyword arguments to the component constructor will be used as defaults for omitted configuration values. The context attribute will by default be the same as the resource name, unless explicitly set with thecontext_attroption.If
gatewaysis omitted, a single gateway resource (default/ctx.java) is published using any extra keyword arguments passed to the component.Parameters: - gateways (
Optional[Dict[str,Dict[str,Any]]]) – a dictionary of resource name ⭢configure_gateway()arguments - default_gateway_args – default values for omitted
configure_gateway()arguments
-
classmethod
configure_gateway(launch_jvm=True, gateway=None, callback_server=False, javaopts=(), classpath='')¶ Configure a Py4J gateway.
Parameters: - launch_jvm (
bool) –Trueto spawn a Java Virtual Machine in a subprocess and connect to it,Falseto connect to an existing Py4J enabled JVM - gateway (
Union[GatewayParameters,Dict[str,Any],None]) – either aGatewayParametersobject or a dictionary of keyword arguments for it - callback_server (
Union[CallbackServerParameters,Dict[str,Any]]) – callback server parameters or a boolean indicating if a callback server is wanted - javaopts (
Iterable[str]) – options passed to Java itself - classpath (
Iterable[str]) – path or iterable of paths to pass to the JVM launcher as the class path
- launch_jvm (
- gateways (