text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta name="collection" content="api">

<TITLE>
MBeanServerConnection (Java 2 Platform SE 5.0)
</TITLE>

<META NAME="keywords" CONTENT="javax.management.MBeanServerConnection interface">
<META NAME="keywords" CONTENT="createMBean()">
<META NAME="keywords" CONTENT="unregisterMBean()">
<META NAME="keywords" CONTENT="getObjectInstance()">
<META NAME="keywords" CONTENT="queryMBeans()">
<META NAME="keywords" CONTENT="queryNames()">
<META NAME="keywords" CONTENT="isRegistered()">
<META NAME="keywords" CONTENT="getMBeanCount()">
<META NAME="keywords" CONTENT="getAttribute()">
<META NAME="keywords" CONTENT="getAttributes()">
<META NAME="keywords" CONTENT="setAttribute()">
<META NAME="keywords" CONTENT="setAttributes()">
<META NAME="keywords" CONTENT="invoke()">
<META NAME="keywords" CONTENT="getDefaultDomain()">
<META NAME="keywords" CONTENT="getDomains()">
<META NAME="keywords" CONTENT="addNotificationListener()">
<META NAME="keywords" CONTENT="removeNotificationListener()">
<META NAME="keywords" CONTENT="getMBeanInfo()">
<META NAME="keywords" CONTENT="isInstanceOf()">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

JavaTM 2 Platform
Standard Ed. 5.0

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

javax.management

Interface MBeanServerConnection

All Known Subinterfaces:
MBeanServer, MBeanServerForwarder

public interface MBeanServerConnection

This interface represents a way to talk to an MBean server, whether
 local or remote.  The MBeanServer interface, representing a
 local MBean server, extends this interface.

Since:

1.5

Method Summary

 void
addNotificationListener(ObjectName name,
                        NotificationListener listener,
                        NotificationFilter filter,
                        Object handback)

          Adds a listener to a registered MBean.

 void
addNotificationListener(ObjectName name,
                        ObjectName listener,
                        NotificationFilter filter,
                        Object handback)

          Adds a listener to a registered MBean.

 ObjectInstance
createMBean(String className,
            ObjectName name)

          Instantiates and registers an MBean in the MBean server.

 ObjectInstance
createMBean(String className,
            ObjectName name,
            Object[] params,
            String[] signature)

          Instantiates and registers an MBean in the MBean server.

 ObjectInstance
createMBean(String className,
            ObjectName name,
            ObjectName loaderName)

          Instantiates and registers an MBean in the MBean server.

 ObjectInstance
createMBean(String className,
            ObjectName name,
            ObjectName loaderName,
            Object[] params,
            String[] signature)

          Instantiates and registers an MBean in the MBean server.

 Object
getAttribute(ObjectName name,
             String attribute)

          Gets the value of a specific attribute of a named MBean.

 AttributeList
getAttributes(ObjectName name,
              String[] attributes)

          Enables the values of several attributes of a named MBean.

 String
getDefaultDomain()

          Returns the default domain used for naming the MBean.

 String[]
getDomains()

          Returns the list of domains in which any MBean is currently
 registered.

 Integer
getMBeanCount()

          Returns the number of MBeans registered in the MBean server.

 MBeanInfo
getMBeanInfo(ObjectName name)

          This method discovers the attributes and operations that an
 MBean exposes for management.

 ObjectInstance
getObjectInstance(ObjectName name)

          Gets the ObjectInstance for a given MBean
 registered with the MBean server.

 Object
invoke(ObjectName name,
       String operationName,
       Object[] params,
       String[] signature)

          Invokes an operation on an MBean.

 boolean
isInstanceOf(ObjectName name,
             String className)

          Returns true if the MBean specified is an instance of the
 specified class, false otherwise.

 boolean
isRegistered(ObjectName name)

          Checks whether an MBean, identified by its object name, is
 already registered with the MBean server.

 Set
queryMBeans(ObjectName name,
            QueryExp query)

          Gets MBeans controlled by the MBean server.

 Set
queryNames(ObjectName name,
           QueryExp query)

          Gets the names of MBeans controlled by the MBean server.

 void
removeNotificationListener(ObjectName name,
                           NotificationListener listener)

          Removes a listener from a registered MBean.

 void
removeNotificationListener(ObjectName name,
                           NotificationListener listener,
                           NotificationFilter filter,
                           Object handback)

          Removes a listener from a registered MBean.

 void
removeNotificationListener(ObjectName name,
                           ObjectName listener)

          Removes a listener from a registered MBean.

 void
removeNotificationListener(ObjectName name,
                           ObjectName listener,
                           NotificationFilter filter,
                           Object handback)

          Removes a listener from a registered MBean.

 void
setAttribute(ObjectName name,
             Attribute attribute)

          Sets the value of a specific attribute of a named MBean.

 AttributeList
setAttributes(ObjectName name,
              AttributeList attributes)

          Sets the values of several attributes of a named MBean.

 void
unregisterMBean(ObjectName name)

          Unregisters an MBean from the MBean server.

Method Detail

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  IOException

Instantiates and registers an MBean in the MBean server.  The
 MBean server will use its Default Loader
 Repository to load the class of the MBean.  An object name is
 associated to the MBean.        If the object name given is null, the
 MBean must provide its own name by implementing the MBeanRegistration interface
 and returning the name from the preRegister method.

This method is equivalent to createMBean(className, name, (Object[]) null, (String[])
 null).

Parameters:
className - The class name of the MBean to be instantiated.
name - The object name of the MBean. May be null.

Returns:
An ObjectInstance, containing the
 ObjectName and the Java class name of the newly
 instantiated MBean.  If the contained ObjectName
 is n, the contained Java class name is
 getMBeanInfo(n).getClassName().

Throws:

ReflectionException - Wraps a
 java.lang.ClassNotFoundException or a
 java.lang.Exception that occurred
 when trying to invoke the MBean's constructor.

InstanceAlreadyExistsException - The MBean is already
 under the control of the MBean server.

MBeanRegistrationException - The
 preRegister (MBeanRegistration
 interface) method of the MBean has thrown an exception. The
 MBean will not be registered.

MBeanException - The constructor of the MBean has
 thrown an exception

NotCompliantMBeanException - This class is not a JMX
 compliant MBean

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The className
 passed in parameter is null, the ObjectName passed
 in parameter contains a pattern or no ObjectName
 is specified for the MBean.

IOException - A communication problem occurred when
 talking to the MBean server.

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name,
                           ObjectName loaderName)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException,
                                  IOException

Instantiates and registers an MBean in the MBean server.  The
 class loader to be used is identified by its object name. An
 object name is associated to the MBean. If the object name of
 the loader is null, the ClassLoader that loaded the MBean
 server will be used.  If the MBean's object name given is null,
 the MBean must provide its own name by implementing the MBeanRegistration interface
 and returning the name from the preRegister method.

This method is equivalent to createMBean(className, name, loaderName, (Object[]) null,
 (String[]) null).

Parameters:
className - The class name of the MBean to be instantiated.
name - The object name of the MBean. May be null.
loaderName - The object name of the class loader to be used.

Returns:
An ObjectInstance, containing the
 ObjectName and the Java class name of the newly
 instantiated MBean.  If the contained ObjectName
 is n, the contained Java class name is
 getMBeanInfo(n).getClassName().

Throws:

ReflectionException - Wraps a
 java.lang.ClassNotFoundException or a
 java.lang.Exception that occurred when trying to
 invoke the MBean's constructor.

InstanceAlreadyExistsException - The MBean is already
 under the control of the MBean server.

MBeanRegistrationException - The
 preRegister (MBeanRegistration
 interface) method of the MBean has thrown an exception. The
 MBean will not be registered.

MBeanException - The constructor of the MBean has
 thrown an exception

NotCompliantMBeanException - This class is not a JMX
 compliant MBean

InstanceNotFoundException - The specified class loader
 is not registered in the MBean server.

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The className
 passed in parameter is null, the ObjectName passed
 in parameter contains a pattern or no ObjectName
 is specified for the MBean.

IOException - A communication problem occurred when
 talking to the MBean server.

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name,
                           Object[] params,
                           String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  IOException

Instantiates and registers an MBean in the MBean server.  The
 MBean server will use its Default Loader
 Repository to load the class of the MBean.  An object name is
 associated to the MBean.  If the object name given is null, the
 MBean must provide its own name by implementing the MBeanRegistration interface
 and returning the name from the preRegister method.

Parameters:
className - The class name of the MBean to be instantiated.
name - The object name of the MBean. May be null.
params - An array containing the parameters of the
 constructor to be invoked.
signature - An array containing the signature of the
 constructor to be invoked.

Returns:
An ObjectInstance, containing the
 ObjectName and the Java class name of the newly
 instantiated MBean.  If the contained ObjectName
 is n, the contained Java class name is
 getMBeanInfo(n).getClassName().

Throws:

ReflectionException - Wraps a
 java.lang.ClassNotFoundException or a
 java.lang.Exception that occurred when trying to
 invoke the MBean's constructor.

InstanceAlreadyExistsException - The MBean is already
 under the control of the MBean server.

MBeanRegistrationException - The
 preRegister (MBeanRegistration
 interface) method of the MBean has thrown an exception. The
 MBean will not be registered.

MBeanException - The constructor of the MBean has
 thrown an exception

NotCompliantMBeanException - This class is not a JMX
 compliant MBean

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The className
 passed in parameter is null, the ObjectName passed
 in parameter contains a pattern or no ObjectName
 is specified for the MBean.

IOException - A communication problem occurred when
 talking to the MBean server.

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name,
                           ObjectName loaderName,
                           Object[] params,
                           String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException,
                                  IOException

Instantiates and registers an MBean in the MBean server.  The
 class loader to be used is identified by its object name. An
 object name is associated to the MBean. If the object name of
 the loader is not specified, the ClassLoader that loaded the
 MBean server will be used.  If the MBean object name given is
 null, the MBean must provide its own name by implementing the
 MBeanRegistration
 interface and returning the name from the preRegister method.

Parameters:
className - The class name of the MBean to be instantiated.
name - The object name of the MBean. May be null.
params - An array containing the parameters of the
 constructor to be invoked.
signature - An array containing the signature of the
 constructor to be invoked.
loaderName - The object name of the class loader to be used.

Returns:
An ObjectInstance, containing the
 ObjectName and the Java class name of the newly
 instantiated MBean.  If the contained ObjectName
 is n, the contained Java class name is
 getMBeanInfo(n).getClassName().

Throws:

ReflectionException - Wraps a
 java.lang.ClassNotFoundException or a
 java.lang.Exception that occurred when trying to
 invoke the MBean's constructor.

InstanceAlreadyExistsException - The MBean is already
 under the control of the MBean server.

MBeanRegistrationException - The
 preRegister (MBeanRegistration
 interface) method of the MBean has thrown an exception. The
 MBean will not be registered.

MBeanException - The constructor of the MBean has
 thrown an exception

NotCompliantMBeanException - This class is not a JMX
 compliant MBean

InstanceNotFoundException - The specified class loader
 is not registered in the MBean server.

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The className
 passed in parameter is null, the ObjectName passed
 in parameter contains a pattern or no ObjectName
 is specified for the MBean.

IOException - A communication problem occurred when
 talking to the MBean server.

unregisterMBean

void unregisterMBean(ObjectName name)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException,
                            IOException

Unregisters an MBean from the MBean server. The MBean is
 identified by its object name. Once the method has been
 invoked, the MBean may no longer be accessed by its object
 name.

Parameters:
name - The object name of the MBean to be unregistered.

Throws:

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

MBeanRegistrationException - The preDeregister
 ((MBeanRegistration interface) method of the MBean
 has thrown an exception.

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The object
 name in parameter is null or the MBean you are when trying to
 unregister is the MBeanServerDelegate MBean.

IOException - A communication problem occurred when
 talking to the MBean server.

getObjectInstance

ObjectInstance getObjectInstance(ObjectName name)
                                 throws InstanceNotFoundException,
                                        IOException

Gets the ObjectInstance for a given MBean
 registered with the MBean server.

Parameters:
name - The object name of the MBean.

Returns:
The ObjectInstance associated with the MBean
 specified by <VAR>name</VAR>.  The contained ObjectName
 is name and the contained class name is
 getMBeanInfo(name).getClassName().

Throws:

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

IOException - A communication problem occurred when
 talking to the MBean server.

queryMBeans

Set queryMBeans(ObjectName name,
                QueryExp query)
                throws IOException

Gets MBeans controlled by the MBean server. This method allows
 any of the following to be obtained: All MBeans, a set of
 MBeans specified by pattern matching on the
 ObjectName and/or a Query expression, a specific
 MBean. When the object name is null or no domain and key
 properties are specified, all objects are to be selected (and
 filtered if a query is specified). It returns the set of
 ObjectInstance objects (containing the
 ObjectName and the Java Class name) for the
 selected MBeans.

Parameters:
name - The object name pattern identifying the MBeans to
 be retrieved. If null or no domain and key properties are
 specified, all the MBeans registered will be retrieved.
query - The query expression to be applied for selecting
 MBeans. If null no query expression will be applied for
 selecting MBeans.

Returns:
A set containing the ObjectInstance
 objects for the selected MBeans.  If no MBean satisfies the
 query an empty list is returned.

Throws:

IOException - A communication problem occurred when
 talking to the MBean server.

queryNames

Set queryNames(ObjectName name,
               QueryExp query)
               throws IOException

Gets the names of MBeans controlled by the MBean server. This
 method enables any of the following to be obtained: The names
 of all MBeans, the names of a set of MBeans specified by
 pattern matching on the ObjectName and/or a Query
 expression, a specific MBean name (equivalent to testing
 whether an MBean is registered). When the object name is null
 or no domain and key properties are specified, all objects are
 selected (and filtered if a query is specified). It returns the
 set of ObjectNames for the MBeans selected.

Parameters:
name - The object name pattern identifying the MBean names
 to be retrieved. If null or no domain and key properties are
 specified, the name of all registered MBeans will be retrieved.
query - The query expression to be applied for selecting
 MBeans. If null no query expression will be applied for
 selecting MBeans.

Returns:
A set containing the ObjectNames for the MBeans
 selected.  If no MBean satisfies the query, an empty list is
 returned.

Throws:

IOException - A communication problem occurred when
 talking to the MBean server.

isRegistered

boolean isRegistered(ObjectName name)
                     throws IOException

Checks whether an MBean, identified by its object name, is
 already registered with the MBean server.

Parameters:
name - The object name of the MBean to be checked.

Returns:
True if the MBean is already registered in the MBean
 server, false otherwise.

Throws:

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The object
 name in parameter is null.

IOException - A communication problem occurred when
 talking to the MBean server.

getMBeanCount

Integer getMBeanCount()
                      throws IOException

Returns the number of MBeans registered in the MBean server.

Returns:
the number of MBeans registered.

Throws:

IOException - A communication problem occurred when
 talking to the MBean server.

getAttribute

Object getAttribute(ObjectName name,
                    String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException,
                           IOException

Gets the value of a specific attribute of a named MBean. The MBean
 is identified by its object name.

Parameters:
name - The object name of the MBean from which the
 attribute is to be retrieved.
attribute - A String specifying the name of the attribute
 to be retrieved.

Returns:
The value of the retrieved attribute.

Throws:

AttributeNotFoundException - The attribute specified
 is not accessible in the MBean.

MBeanException - Wraps an exception thrown by the
 MBean's getter.

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

ReflectionException - Wraps a
 java.lang.Exception thrown when trying to invoke
 the setter.

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The object
 name in parameter is null or the attribute in parameter is
 null.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
setAttribute(javax.management.ObjectName, javax.management.Attribute)

getAttributes

AttributeList getAttributes(ObjectName name,
                            String[] attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   IOException

Enables the values of several attributes of a named MBean. The MBean
 is identified by its object name.

Parameters:
name - The object name of the MBean from which the
 attributes are retrieved.
attributes - A list of the attributes to be retrieved.

Returns:
The list of the retrieved attributes.

Throws:

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

ReflectionException - An exception occurred when
 trying to invoke the getAttributes method of a Dynamic MBean.

RuntimeOperationsException - Wrap a
 java.lang.IllegalArgumentException: The object
 name in parameter is null or attributes in parameter is null.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
setAttributes(javax.management.ObjectName, javax.management.AttributeList)

setAttribute

void setAttribute(ObjectName name,
                  Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException,
                         IOException

Sets the value of a specific attribute of a named MBean. The MBean
 is identified by its object name.

Parameters:
name - The name of the MBean within which the attribute is
 to be set.
attribute - The identification of the attribute to be set
 and the value it is to be set to.

Throws:

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

AttributeNotFoundException - The attribute specified
 is not accessible in the MBean.

InvalidAttributeValueException - The value specified
 for the attribute is not valid.

MBeanException - Wraps an exception thrown by the
 MBean's setter.

ReflectionException - Wraps a
 java.lang.Exception thrown when trying to invoke
 the setter.

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The object
 name in parameter is null or the attribute in parameter is
 null.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
getAttribute(javax.management.ObjectName, java.lang.String)

setAttributes

AttributeList setAttributes(ObjectName name,
                            AttributeList attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   IOException

Sets the values of several attributes of a named MBean. The MBean is
 identified by its object name.

Parameters:
name - The object name of the MBean within which the
 attributes are to be set.
attributes - A list of attributes: The identification of
 the attributes to be set and the values they are to be set to.

Returns:
The list of attributes that were set, with their new
 values.

Throws:

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

ReflectionException - An exception occurred when
 trying to invoke the getAttributes method of a Dynamic MBean.

RuntimeOperationsException - Wraps a
 java.lang.IllegalArgumentException: The object
 name in parameter is null or attributes in parameter is null.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
getAttributes(javax.management.ObjectName, java.lang.String[])

invoke

Object invoke(ObjectName name,
              String operationName,
              Object[] params,
              String[] signature)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException,
                     IOException

Invokes an operation on an MBean.

Parameters:
name - The object name of the MBean on which the method is
 to be invoked.
operationName - The name of the operation to be invoked.
params - An array containing the parameters to be set when
 the operation is invoked
signature - An array containing the signature of the
 operation. The class objects will be loaded using the same
 class loader as the one used for loading the MBean on which the
 operation was invoked.

Returns:
The object returned by the operation, which represents
 the result of invoking the operation on the MBean specified.

Throws:

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

MBeanException - Wraps an exception thrown by the
 MBean's invoked method.

ReflectionException - Wraps a
 java.lang.Exception thrown while trying to invoke
 the method.

IOException - A communication problem occurred when
 talking to the MBean server.

getDefaultDomain

String getDefaultDomain()
                        throws IOException

Returns the default domain used for naming the MBean.
 The default domain name is used as the domain part in the ObjectName
 of MBeans if no domain is specified by the user.

Returns:
the default domain.

Throws:

IOException - A communication problem occurred when
 talking to the MBean server.

getDomains

String[] getDomains()
                    throws IOException

Returns the list of domains in which any MBean is currently
 registered.  A string is in the returned array if and only if
 there is at least one MBean registered with an ObjectName whose
 getDomain() is equal to that
 string.  The order of strings within the returned array is
 not defined.

Returns:
the list of domains.

Throws:

IOException - A communication problem occurred when
 talking to the MBean server.

addNotificationListener

void addNotificationListener(ObjectName name,
                             NotificationListener listener,
                             NotificationFilter filter,
                             Object handback)
                             throws InstanceNotFoundException,
                                    IOException

Adds a listener to a registered MBean.

 A notification emitted by an MBean will be forwarded by the
 MBeanServer to the listener.  If the source of the notification
 is a reference to an MBean object, the MBean server will replace it
 by that MBean's ObjectName.  Otherwise the source is unchanged.

Parameters:
name - The name of the MBean on which the listener should
 be added.
listener - The listener object which will handle the
 notifications emitted by the registered MBean.
filter - The filter object. If filter is null, no
 filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a
 notification is emitted.

Throws:

InstanceNotFoundException - The MBean name provided
 does not match any of the registered MBeans.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
removeNotificationListener(ObjectName, NotificationListener),
removeNotificationListener(ObjectName, NotificationListener,
 NotificationFilter, Object)

addNotificationListener

void addNotificationListener(ObjectName name,
                             ObjectName listener,
                             NotificationFilter filter,
                             Object handback)
                             throws InstanceNotFoundException,
                                    IOException

Adds a listener to a registered MBean.

A notification emitted by an MBean will be forwarded by the
 MBeanServer to the listener.  If the source of the notification
 is a reference to an MBean object, the MBean server will
 replace it by that MBean's ObjectName.  Otherwise the source is
 unchanged.

The listener object that receives notifications is the one
 that is registered with the given name at the time this method
 is called.  Even if it is subsequently unregistered, it will
 continue to receive notifications.

Parameters:
name - The name of the MBean on which the listener should
 be added.
listener - The object name of the listener which will
 handle the notifications emitted by the registered MBean.
filter - The filter object. If filter is null, no
 filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a
 notification is emitted.

Throws:

InstanceNotFoundException - The MBean name of the
 notification listener or of the notification broadcaster does
 not match any of the registered MBeans.

RuntimeOperationsException - Wraps an IllegalArgumentException.  The MBean named by
 listener exists but does not implement the NotificationListener interface.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
removeNotificationListener(ObjectName, ObjectName),
removeNotificationListener(ObjectName, ObjectName,
 NotificationFilter, Object)

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                ObjectName listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException

Removes a listener from a registered MBean.

 If the listener is registered more than once, perhaps with
 different filters or callbacks, this method will remove all
 those registrations.

Parameters:
name - The name of the MBean on which the listener should
 be removed.
listener - The object name of the listener to be removed.

Throws:

InstanceNotFoundException - The MBean name provided
 does not match any of the registered MBeans.

ListenerNotFoundException - The listener is not
 registered in the MBean.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
addNotificationListener(ObjectName, ObjectName,
 NotificationFilter, Object)

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                ObjectName listener,
                                NotificationFilter filter,
                                Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException

Removes a listener from a registered MBean.

The MBean must have a listener that exactly matches the
 given listener, filter, and
 handback parameters.  If there is more than one
 such listener, only one is removed.

The filter and handback parameters
 may be null if and only if they are null in a listener to be
 removed.

Parameters:
name - The name of the MBean on which the listener should
 be removed.
listener - A listener that was previously added to this
 MBean.
filter - The filter that was specified when the listener
 was added.
handback - The handback that was specified when the
 listener was added.

Throws:

InstanceNotFoundException - The MBean name provided
 does not match any of the registered MBeans.

ListenerNotFoundException - The listener is not
 registered in the MBean, or it is not registered with the given
 filter and handback.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
addNotificationListener(ObjectName, ObjectName,
 NotificationFilter, Object)

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException

Removes a listener from a registered MBean.

 If the listener is registered more than once, perhaps with
 different filters or callbacks, this method will remove all
 those registrations.

Parameters:
name - The name of the MBean on which the listener should
 be removed.
listener - The object name of the listener to be removed.

Throws:

InstanceNotFoundException - The MBean name provided
 does not match any of the registered MBeans.

ListenerNotFoundException - The listener is not
 registered in the MBean.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
addNotificationListener(ObjectName, NotificationListener,
 NotificationFilter, Object)

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                NotificationListener listener,
                                NotificationFilter filter,
                                Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException

Removes a listener from a registered MBean.

The MBean must have a listener that exactly matches the
 given listener, filter, and
 handback parameters.  If there is more than one
 such listener, only one is removed.

The filter and handback parameters
 may be null if and only if they are null in a listener to be
 removed.

Parameters:
name - The name of the MBean on which the listener should
 be removed.
listener - A listener that was previously added to this
 MBean.
filter - The filter that was specified when the listener
 was added.
handback - The handback that was specified when the
 listener was added.

Throws:

InstanceNotFoundException - The MBean name provided
 does not match any of the registered MBeans.

ListenerNotFoundException - The listener is not
 registered in the MBean, or it is not registered with the given
 filter and handback.

IOException - A communication problem occurred when
 talking to the MBean server.
See Also:
addNotificationListener(ObjectName, NotificationListener,
 NotificationFilter, Object)

getMBeanInfo

MBeanInfo getMBeanInfo(ObjectName name)
                       throws InstanceNotFoundException,
                              IntrospectionException,
                              ReflectionException,
                              IOException

This method discovers the attributes and operations that an
 MBean exposes for management.

Parameters:
name - The name of the MBean to analyze

Returns:
An instance of MBeanInfo allowing the
 retrieval of all attributes and operations of this MBean.

Throws:

IntrospectionException - An exception occurred during
 introspection.

InstanceNotFoundException - The MBean specified was
 not found.

ReflectionException - An exception occurred when
 trying to invoke the getMBeanInfo of a Dynamic MBean.

IOException - A communication problem occurred when
 talking to the MBean server.

isInstanceOf

boolean isInstanceOf(ObjectName name,
                     String className)
                     throws InstanceNotFoundException,
                            IOException

Returns true if the MBean specified is an instance of the
 specified class, false otherwise.

If name does not name an MBean, this method
 throws InstanceNotFoundException.

Otherwise, let

 X be the MBean named by name,

 L be the ClassLoader of X,

 N be the class name in X's MBeanInfo.

If N equals className, the result is true.

Otherwise, if L successfully loads both N and
 className, and the second class is assignable from
 the first, the result is true.

Otherwise, the result is false.

Parameters:
name - The ObjectName of the MBean.
className - The name of the class.

Returns:
true if the MBean specified is an instance of the
 specified class according to the rules above, false otherwise.

Throws:

InstanceNotFoundException - The MBean specified is not
 registered in the MBean server.

IOException - A communication problem occurred when
 talking to the MBean server.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

JavaTM 2 Platform
Standard Ed. 5.0

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


text:
<?xml version="1.0" ?>
<!DOCTYPE FTCS SYSTEM "futuretense_cs.dtd">
<FTCS Version="1.1">
<!-- OpenMarket/Xcelerate/AssetType/SiteEntry/XMLPostPreUpdate
-
- INPUT
-
- OUTPUT
-
-->
	<SETVAR NAME="errdetail1" VALUE="Variables.empty"/>

	<IF COND="IsVariable.SiteEntry_name=true"><THEN>
		<SETVAR NAME="SiteEntry:name" VALUE="Variables.SiteEntry_name"/>
	</THEN><ELSE>
             <XLAT.LOOKUP KEY="dvin/UI/Missingname" VARNAME="_XLAT_"/>
			<SETVAR NAME="errdetail1" VALUE="Variables.errdetail1 Variables._XLAT_,"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_pagename=true"><THEN>
		<SETVAR NAME="SiteEntry:pagename" VALUE="Variables.SiteEntry_pagename"/>
	</THEN><ELSE>
               <XLAT.LOOKUP KEY="dvin/UI/MissingPagename" VARNAME="_XLAT_"/>
			<SETVAR NAME="errdetail1" VALUE="Variables.errdetail1 Variables._XLAT_"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_rootelement=true"><THEN>
		<SETVAR NAME="SiteEntry:rootelement" VALUE="Variables.SiteEntry_rootelement"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:rootelement" VALUE="Variables.empty"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_csstatus=true"><THEN>
		<SETVAR NAME="SiteEntry:csstatus" VALUE="Variables.SiteEntry_csstatus"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:csstatus" VALUE="live"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_description=true"><THEN>
		<SETVAR NAME="SiteEntry:description" VALUE="Variables.SiteEntry_description"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:description" VALUE="Variables.empty"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_template=true"><THEN>
		<SETVAR NAME="SiteEntry:template" VALUE="Variables.SiteEntry_template"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:template" VALUE="OpenMarket/SiteEntryTemplate"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_acl=true"><THEN>
		<SETVAR NAME="SiteEntry:acl" VALUE="Variables.SiteEntry_acl"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:acl" VALUE="Variables.empty"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_cacheinfo=true"><THEN>
		<SETVAR NAME="SiteEntry:cscacheinfo" VALUE="Variables.SiteEntry_cacheinfo"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:cscacheinfo" VALUE="Variables.empty"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_cscacheinfo=true"><THEN>
		<SETVAR NAME="SiteEntry:cscacheinfo" VALUE="Variables.SiteEntry_cscacheinfo"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:cacheinfo" VALUE="Variables.empty"/>
	</ELSE></IF>
	<IF COND="IsVariable.SiteEntry_sscacheinfo=true"><THEN>
		<SETVAR NAME="SiteEntry:sscacheinfo" VALUE="Variables.SiteEntry_sscacheinfo"/>
	</THEN><ELSE>
		<SETVAR NAME="SiteEntry:ssacheinfo" VALUE="Variables.empty"/>
	</ELSE></IF>
	<SETCOUNTER NAME="numCriteria" VALUE="0"/>
	<SETCOUNTER NAME="numArgs" VALUE="0"/>
	<!-- old style - resargs1 and resargs2 variables -->
	<IF COND="IsVariable.SiteEntry_resargs1=true"><THEN>
		<STRINGLIST STR="Variables.SiteEntry_resargs1" NAME="args" DELIM=","/>
		<LOOP LIST="args">
			<BEGINS STR="args.ITEM" WHAT="PageCriteria="/>
			<!-- if this isn't Pagecriteris then add it to the default args -->
			<IF COND="Variables.errno=0">
			<THEN>
				<STRINGLIST STR="args.ITEM" NAME="onearg" DELIM="="/>
				<SETVAR NAME="SiteEntry:defaultarguments:Counters.numArgs:name" VALUE="onearg.ITEM"/>
				<GOTOROW LIST="onearg" ROWNUM="2"/>
				<SETVAR NAME="SiteEntry:defaultarguments:Counters.numArgs:value" VALUE="onearg.ITEM"/>
				<INCCOUNTER NAME="numArgs" VALUE="1"/>
			</THEN>
			<ELSE>
				<!-- PageCriteria -->
				<SUBSTRING STR="args.ITEM" OUTSTR="criteria" INDEX="13"/>
				<STRINGLIST STR="Variables.criteria" NAME="pcriteria" DELIM=","/>
				<LOOP LIST="Variables.pcriteria">
					<SETVAR NAME="SiteEntry:pagecriteria:Counters.numCriteria" VALUE="pcriteria.ITEM"/>
					<INCCOUNTER NAME="numCriteria" VALUE="1"/>
				</LOOP>
			</ELSE>
			</IF>
		</LOOP>
	</THEN>
	</IF>
	<IF COND="IsVariable.SiteEntry_resargs2=true"><THEN>
		<STRINGLIST STR="Variables.SiteEntry_resargs2" NAME="args" DELIM=","/>
		<LOOP LIST="args">
			<BEGINS STR="args.ITEM" WHAT="PageCriteria="/>
			<!-- if this isn't Pagecriteris then add it to the default args -->
			<IF COND="Variables.errno=0">
			<THEN>
				<STRINGLIST STR="args.ITEM" NAME="onearg" DELIM="="/>
				<SETVAR NAME="SiteEntry:defaultarguments:Counters.numArgs:name" VALUE="onearg.ITEM"/>
				<GOTOROW LIST="onearg" ROWNUM="2"/>
				<SETVAR NAME="SiteEntry:defaultarguments:Counters.numArgs:value" VALUE="onearg.ITEM"/>
				<INCCOUNTER NAME="numArgs" VALUE="1"/>
			</THEN>
			<ELSE>
				<!-- PageCriteria -->
				<SUBSTRING STR="args.ITEM" OUTSTR="criteria" INDEX="13"/>
				<STRINGLIST STR="Variables.criteria" NAME="pcriteria" DELIM=","/>
				<LOOP LIST="Variables.pcriteria">
					<SETVAR NAME="SiteEntry:pagecriteria:Counters.numCriteria" VALUE="pcriteria.ITEM"/>
					<INCCOUNTER NAME="numCriteria" VALUE="1"/>
				</LOOP>
			</ELSE>
			</IF>
		</LOOP>
	</THEN></IF>
	<!-- new style - using defaultarguments and pagecriteria -->
	<IF COND="IsVariable.SiteEntry_defaultarguments=true"><THEN>
		<STRINGLIST STR="Variables.SiteEntry_defaultarguments" NAME="dargs" DELIM=","/>
		<LOOP LIST="dargs">
			<STRINGLIST STR="dargs.ITEM" NAME="onearg" DELIM="="/>
			<SETVAR NAME="SiteEntry:defaultarguments:Counters.numArgs:name" VALUE="onearg.ITEM"/>
			<GOTOROW LIST="onearg" ROWNUM="2"/>
			<SETVAR NAME="SiteEntry:defaultarguments:Counters.numArgs:value" VALUE="onearg.ITEM"/>
			<INCCOUNTER NAME="numArgs" VALUE="1"/>
		</LOOP>
	</THEN></IF>
	<IF COND="IsVariable.SiteEntry_pagecriteria=true"><THEN>
		<STRINGLIST STR="Variables.SiteEntry_pagecriteria" NAME="pcriteria" DELIM=","/>
		<LOOP LIST="Variables.pcriteria">
			<SETVAR NAME="SiteEntry:pagecriteria:Counters.numCriteria" VALUE="pcriteria.ITEM"/>
			<INCCOUNTER NAME="numCriteria" VALUE="1"/>
		</LOOP>
	</THEN></IF>

	<SETVAR NAME="SiteEntry:defaultarguments:Total" VALUE="Counters.numArgs"/>
	<SETVAR NAME="SiteEntry:pagecriteria:Total" VALUE="Counters.numCriteria"/>

	<IF COND="Variables.errdetail1!=Variables.empty"><THEN>
		<SETVAR NAME="errno" VALUE="-12001"/>  <!-- missing field -->
	</THEN><ELSE>
		<SETVAR NAME="errno" VALUE="0"/>
	</ELSE></IF>
</FTCS>

redpajama_set_name: RedPajamaGithub


text:
#region Copyright notice and license

// Copyright 2019 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#endregion

using Grpc.Core;

namespace Grpc.AspNetCore.Server.Tests.TestObjects.Services.WithoutAttribute;

public static partial class GreeterWithoutAttribute
{
    const string __ServiceName = "Greet.Greeter";

    static readonly Marshaller<global::Greet.HelloRequest> __Marshaller_Greet_HelloRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.HelloRequest.Parser.ParseFrom);
    static readonly Marshaller<global::Greet.HelloReply> __Marshaller_Greet_HelloReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.HelloReply.Parser.ParseFrom);

    static readonly Method<global::Greet.HelloRequest, global::Greet.HelloReply> __Method_SayHello = new Method<global::Greet.HelloRequest, global::Greet.HelloReply>(
        MethodType.Unary,
        __ServiceName,
        "SayHello",
        __Marshaller_Greet_HelloRequest,
        __Marshaller_Greet_HelloReply);

    static readonly Method<global::Greet.HelloRequest, global::Greet.HelloReply> __Method_SayHellos = new Method<global::Greet.HelloRequest, global::Greet.HelloReply>(
        MethodType.ServerStreaming,
        __ServiceName,
        "SayHellos",
        __Marshaller_Greet_HelloRequest,
        __Marshaller_Greet_HelloReply);

    public abstract partial class GreeterBase
    {
        public virtual global::System.Threading.Tasks.Task<global::Greet.HelloReply> SayHello(global::Greet.HelloRequest request, ServerCallContext context)
        {
            throw new RpcException(new Status(StatusCode.Unimplemented, ""));
        }

        public virtual global::System.Threading.Tasks.Task SayHellos(global::Greet.HelloRequest request, IServerStreamWriter<global::Greet.HelloReply> responseStream, ServerCallContext context)
        {
            throw new RpcException(new Status(StatusCode.Unimplemented, ""));
        }
    }

    public static ServerServiceDefinition BindService(GreeterBase serviceImpl)
    {
        throw new NotImplementedException();
    }

    public static void BindService(ServiceBinderBase serviceBinder, GreeterBase serviceImpl)
    {
        serviceBinder.AddMethod(__Method_SayHello, (UnaryServerMethod<global::Greet.HelloRequest, global::Greet.HelloReply>)null!);
        serviceBinder.AddMethod(__Method_SayHellos, (ServerStreamingServerMethod<global::Greet.HelloRequest, global::Greet.HelloReply>)null!);
    }
}


text:
gogoCLIENT Luci configuration page.Made by 981213
]]--

module("luci.controller.gw6c", package.seeall)

function index()

	if not nixio.fs.access("/etc/config/gw6c") then
		return
	end

	local page
	page = entry({"admin", "network", "gw6c"}, cbi("gw6c"), _("gogoCLIENT"), 45)
	page.dependent = true
end


text:
package com.codeforces.commons.cache.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author Maxim Shipko (sladethe@gmail.com)
 *         Date: 24.01.12
 */
@Target({PARAMETER})
@Retention(RUNTIME)
public @interface CacheSection {
}


text:
.. File generated by /hepuser/crlb/Git/cloudscheduler/utilities/cli_doc_to_rst - DO NOT EDIT
..
.. To modify the contents of this file:
..   1. edit the man page file(s) ".../cloudscheduler/cli/man/csv2_cloud_metadata-save.1"
..   2. run the utility ".../cloudscheduler/utilities/cli_doc_to_rst"
..

man(1) page: cloudscheduler cloud metadata-save
===============================================


text:
/** @file
 * implementation of utility functions
 * @defgroup utilities utility functions
 * @{
 */

#include <cstdio>
#include <iostream>
#include <string>
#include <string.h>

#include <iom/iom_p.h>

#include <sys/types.h>
#include <sys/stat.h>

#if defined(__MSVCRT__) || defined(_MSC_VER)
#define stat _stat
#else
#include <unistd.h>
#endif

#if !defined(__MSVCRT__) && !defined(_MSC_VER)

#include <stdlib.h>
#include <string.h>

#define PATHSEP ':'

/*
  _searchenv is a function provided by the MSVC library that finds
  files which may be anywhere along a path which appears in an
  environment variable.
*/

static void _searchenv(const char *name, const char *envname, char *hitfile)
{

	// Default failure indication
	*hitfile = '\0';

	// If the given name is absolute, then don't search the
	//   path, but use it as is.
	if(
#ifdef WIN32
		strchr(name, ':') != NULL || // Contain a drive spec?
		name[0] == '\\' ||		// Start with absolute ref?
#endif
		name[0] == '/')			// Start with absolute ref?
	{
		// Copy to target
		strcpy(hitfile, name);
		return;
	}

	char *cp;
	cp = getenv(envname);
	if(cp == NULL){
		// Variable not defined, no search.
		return;
	}

	while(*cp)
	{
		*hitfile = '\0';
		char *concat;
		concat=hitfile;
		// skip PATHSEP (and empty entries)
		while(*cp && *cp==PATHSEP){
			cp++;
		}
		// copy path
		while(*cp && *cp!=PATHSEP){
			*concat=*cp;
			cp++;
			concat++;
		}
		// end of variable value reached?
		if(concat==hitfile){
			// file not found
			*hitfile = '\0';
			return;
		}
		// does no trailing '/' exists?
		if(*(concat-1) != '/' && *(concat-1) != '\\'){
			// append it
			*concat='/';
			concat++;
		}
		// append file name
		strcpy(concat, name);
		// does file exist?
		if(iom_fileexists(hitfile))
		{
			// file found
			return;
		}
	}
	// file not found
	*hitfile = '\0';
}

#endif

static char *tmpdir=0;
static XMLTranscoder *utf8_transcoder=0;

/** Perform iom library initialization.
 */
extern "C" void iom_init()
{
	//__asm { int 3 };

	try {
           XMLPlatformUtils::Initialize();
    }
    catch (const XMLException& toCatch) {
        char* message = XMLString::transcode(toCatch.getMessage());
		iom_issueerr(message);
        XMLString::release(&message);
        return;
    }
    XMLTransService::Codes resCode;
    utf8_transcoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor
    (
        "UTF-8"
        , resCode
        , 16 * 1024
    );
	tags::clear();

}

/* Compatibility stuff due to change of Xerces-C API signature (#2616) */
#if XERCES_VERSION_MAJOR >= 3
#define LEN_SIZE_TYPE XMLSize_t
#else
#define LEN_SIZE_TYPE unsigned int
#endif

/** transcode a xerces unicode string to an utf8 encoded one.
*/
char *iom_toUTF8(const XMLCh *src)
{
	LEN_SIZE_TYPE srcLen=XMLString::stringLen(src);
	LEN_SIZE_TYPE destLen=srcLen+10;
	XMLByte *dest;
	dest=dbgnew XMLByte[destLen+1];
	LEN_SIZE_TYPE eaten;
	LEN_SIZE_TYPE endDest;
	endDest=utf8_transcoder->transcodeTo(src,srcLen,dest,destLen,eaten,XMLTranscoder::UnRep_RepChar);
	while(eaten<srcLen){
		delete[] dest;
		destLen=destLen+srcLen-eaten+10;
		dest=dbgnew XMLByte[destLen+1];
		endDest=utf8_transcoder->transcodeTo(src,srcLen,dest,destLen,eaten,XMLTranscoder::UnRep_RepChar);
	}
	dest[endDest]=0;
	return (char*)dest; /* should be a unsigned char* == XMLByte* instead */
}

/** transcode an utf8 encoded string to a xerces unicode one.
*/
XMLCh *iom_fromUTF8(const char *src)
{
	LEN_SIZE_TYPE srcLen=XMLString::stringLen(src);
	LEN_SIZE_TYPE destLen=srcLen;
	XMLCh *dest=dbgnew XMLCh[destLen+1];
	unsigned char *charSizes=dbgnew unsigned char[destLen];
	LEN_SIZE_TYPE eaten;
	LEN_SIZE_TYPE endDest=utf8_transcoder->transcodeFrom((const XMLByte *)src,srcLen,dest,destLen,eaten,charSizes);
	dest[endDest]=0;
	delete[] charSizes;
	return dest;
}

/** Perform iom library termination.
 */
extern "C" void iom_end()
{

	ParserHandler::at_iom_end();
	ErrorUtility::at_iom_end();
	tags::clear();
	XMLPlatformUtils::Terminate();
}

/** sets the directory where iom writes temporary files.
 */
extern "C" void iom_settmpdir(const char *dirname)
{
	if(tmpdir)free(tmpdir);
	tmpdir=strdup(dirname);
}

/** creates a temporary filename.
 * The caller should free the returned buffer.
 */
extern "C" char *iom_gettmpnam()
{
#ifdef _MSC_VER
	return _tempnam(tmpdir,"iom");
#else
	return tempnam(tmpdir,"iom");
#endif
}

/** Searches for a file in
 *  a directory specified by an environment variable.
 * Returns 0 if file not found.
 * Returns a pointer to a static buffer.
 */
extern "C" char *iom_searchenv(const char *filename, const char *varname)
{
	static char pathbuffer[IOM_PATH_MAX];
	_searchenv( filename, varname, pathbuffer );
	if( *pathbuffer != '\0' ){
		return pathbuffer;
	}
	// file not found
	return 0;
}

/** Tests if a file exists.
 * Returns !0 if file exists.
 */
extern "C" int iom_fileexists(const char *filename)
{
	struct stat info;
	// does file exist?
	if(!stat(filename, &info))
	{
		// file found
		return true;
	}
	return false;
}

/** Returns the current time in milliseconds.
 */
extern "C" unsigned long iom_currentmilis()
{
	return XMLPlatformUtils::getCurrentMillis();
}

/**
 * @}
 */


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.github.somi92.sqldbb.broker;

import com.github.somi92.sqldbb.entity.DatabaseEntity;
import com.github.somi92.sqldbb.entity.processor.EntityProcessor;
import com.github.somi92.sqldbb.query.Query;
import com.github.somi92.sqldbb.query.builder.DeleteQueryBuilder;
import com.github.somi92.sqldbb.query.builder.InsertQueryBuilder;
import com.github.somi92.sqldbb.query.builder.QueryBuilder;
import com.github.somi92.sqldbb.query.builder.SelectQueryBuilder;
import com.github.somi92.sqldbb.query.builder.UpdateQueryBuilder;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author milos
 */
public class DBBroker {

    private Connection connection;

    private static String databaseServer = "mysql";
    private static String databaseDriver = "com.mysql.jdbc.Driver";
    private static String hostPort = "localhost:3306";
    private static String database = "sqldbb-test";
    private static String username = "seecsk";
    private static String password = "seecsk@2015";

    public String getDatabaseServer() {
        return databaseServer;
    }

    public void setDatabaseServer(String databaseServer) {
        this.databaseServer = databaseServer;
    }

    public String getDatabaseDriver() {
        return databaseDriver;
    }

    public void setDatabaseDriver(String databaseDriver) {
        this.databaseDriver = databaseDriver;
    }

    public String getHostPort() {
        return hostPort;
    }

    public void setHostPort(String hostPort) {
        this.hostPort = hostPort;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    private void loadDBDriver() throws ClassNotFoundException {
        Class.forName(databaseDriver);
    }

    public void openDatabaseConnection() throws Exception {
        try {
            loadDBDriver();
//            connection = DriverManager.
//                    getConnection("jdbc:mysql://"+hostPort+"/"+database+"?useUnicode=yes&characterEncoding=UTF-8", username, password);

            connection = DriverManager.
                    getConnection(constructURL(), username, password);

            System.out.println("Connected to database: "+hostPort+"/"+database);
            connection.setAutoCommit(false);
        } catch (ClassNotFoundException ex) {
            System.out.println("Error loading driver: "+ex.getMessage());
            throw new RuntimeException("Error loading driver: "+ex.getMessage());
        } catch (SQLException ex) {
            System.out.println("Error opening database: "+ex.getMessage());
            throw new Exception("Error opening database: "+ex.getMessage());
        }
    }

    public void closeDatabaseConnection() throws Exception {
        try {
            connection.close();
            System.out.println("Disconnected from database: "+hostPort+"/"+database);
        } catch (SQLException ex) {
            System.out.println("Error closing database: "+ex.getMessage());
            throw new Exception("Error closing database: "+ex.getMessage());
        }
    }

    public void commitTransaction() {
        try {
            connection.commit();
        } catch (SQLException ex) {
            System.out.println("Error commiting transaction: "+ex.getMessage());
        }
    }

    public void rollbackTransaction() {
        try {
            connection.rollback();
        } catch (SQLException ex) {
            System.out.println("Error on transaction rollback: "+ex.getMessage());
        }
    }

    private String constructURL() {
        String url = "";
        if(databaseServer.equals("mysql")) {
            url = "jdbc:mysql://"+hostPort+"/"+database+"?useUnicode=yes&characterEncoding=UTF-8";
        }
        if(databaseServer.equals("access")) {
            url = "jdbc:odbc:"+database;
        }
        if(databaseServer.equals("sqlserver")) {
            url = "jdbc:sqlserver://"+hostPort+";databaseName="+database;
        }
        if(databaseServer.equals("oracle")) {
            url = "jdbc:oracle:thin:@"+hostPort+":"+database;
        }
        return url;
    }

    /* Utility methods */
    private ResultSet executePreparedStatementQuery(DatabaseEntity dbe, Query query) throws SQLException {
//        PreparedStatement ps = connection.fillPreparedStatement(query.toString());
//        if(query.toString().contains("?")) {
//
//        }
        return null;
    }

    /* CRUD operations */

    public <T> long count(T o) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(o.getClass());
        String query = "SELECT count("+dbe.getPrimaryKeys().get(0)+") as counter FROM "+dbe.getTableName()+";";
        Statement stm = connection.createStatement();
        ResultSet rs = stm.executeQuery(query);
        long counter = 0;
        while(rs.next()) {
            counter = rs.getLong("counter");
        }
        rs.close();
        stm.close();
        return counter;
    }

    public <T> String getMaxColumnValue(T o, String field, String columnValueCondition) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(o.getClass());
        String query = null;
        if(columnValueCondition == null) {
            query = "SELECT max("+dbe.getFieldColumnMapping().get(field)+") as max FROM "+dbe.getTableName()+";";
        } else {
            query = "SELECT max("+dbe.getFieldColumnMapping().get(field)+") as max FROM "+dbe.getTableName()+
                    " WHERE "+columnValueCondition+";";
        }
        Statement stm = connection.createStatement();
        ResultSet rs = stm.executeQuery(query);
        String maxValue = null;
        while(rs.next()) {
            maxValue = rs.getObject("max", String.class);
        }
        rs.close();
        stm.close();
        return maxValue;
    }

    public <T> int saveOrUpdateEntity(T o) throws SQLException {
        T t = loadEntity(o, false);
        if(t == null) {
            return insertEntity(o);
        } else {
            return updateEntity(o);
        }
    }

    public <T> T loadEntity(T o, boolean loadCollections) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(o.getClass());
        EntityProcessor.setEntityFieldValues(dbe, o);
        QueryBuilder qb = new QueryBuilder(new SelectQueryBuilder(true));
        qb.buildQuery(dbe);
        Query query = qb.getQuery();
        PreparedStatement ps = connection.prepareStatement(query.toString());
        qb.fillPreparedStatement(ps, dbe);
        ResultSet rs = ps.executeQuery();
        T entity = null;
        while(rs.next()) {
            entity = createTypeInstance(dbe, rs, loadCollections);
        }
        rs.close();
        ps.close();
        return entity;
    }

    public <T> List<T> loadEntities(T o, List<String> searchCriteria, boolean loadCollections) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(o.getClass());
        QueryBuilder qb;
        if(searchCriteria != null) {
            qb = new QueryBuilder(new SelectQueryBuilder(searchCriteria));
        } else {
            qb = new QueryBuilder(new SelectQueryBuilder(false));
        }
        qb.buildQuery(dbe);
        Query query = qb.getQuery();
        ResultSet rs;
        Statement statement;
        if(searchCriteria != null) {
            if(query.isUsePS()) {
                PreparedStatement ps = connection.prepareStatement(query.toString());
                EntityProcessor.setEntityFieldValues(dbe, o);
                qb.fillPreparedStatement(ps, dbe);
                rs = ps.executeQuery();
                statement = ps;
            } else {
                statement = connection.createStatement();
                rs = statement.executeQuery(query.toString());
            }
        } else {
            statement = connection.createStatement();
            rs = statement.executeQuery(query.toString());
        }
        List<T> entities = new ArrayList<>();
        while(rs.next()) {
            T entity = createTypeInstance(dbe, rs, loadCollections);
            entities.add(entity);
        }
        rs.close();
        statement.close();
        return entities;
    }

    public <T> int insertEntity(T o) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(o.getClass());
        EntityProcessor.setEntityFieldValues(dbe, o);
        QueryBuilder qb = new QueryBuilder(new InsertQueryBuilder());
        qb.buildQuery(dbe);
        Query query = qb.getQuery();
        PreparedStatement ps = connection.prepareStatement(query.toString());
        qb.fillPreparedStatement(ps, dbe);
        int rowsAffected = ps.executeUpdate();
        ps.close();
        return rowsAffected;
    }

    public <T> int[] insertEntities(List<T> list) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(list.get(0).getClass());
        QueryBuilder qb = new QueryBuilder(new InsertQueryBuilder());
        qb.buildQuery(dbe);
        Query query = qb.getQuery();
        int[] returnValue = null;
        PreparedStatement ps = connection.prepareStatement(query.toString());
        for(int i=0; i<list.size(); i++) {
            EntityProcessor.setEntityFieldValues(dbe, list.get(i));
            qb.fillPreparedStatement(ps, dbe);
            ps.addBatch();
            if((i+1)%500 == 0) {
                ps.executeBatch();
            }
        }
        returnValue = ps.executeBatch();
        ps.close();
        return returnValue;
    }

    public <T> int updateEntity(T o) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(o.getClass());
        EntityProcessor.setEntityFieldValues(dbe, o);
        QueryBuilder qb = new QueryBuilder(new UpdateQueryBuilder());
        qb.buildQuery(dbe);
        Query query = qb.getQuery();
        PreparedStatement ps = connection.prepareStatement(query.toString());
        qb.fillPreparedStatement(ps, dbe);
        int rowsAffected = ps.executeUpdate();
        ps.close();
        return rowsAffected;
    }

    public <T> int deleteEntity(T o) throws SQLException {
        DatabaseEntity dbe = EntityProcessor.createEntity(o.getClass());
        EntityProcessor.setEntityFieldValues(dbe, o);
        QueryBuilder qb = new QueryBuilder(new DeleteQueryBuilder(false));
        qb.buildQuery(dbe);
        Query query = qb.getQuery();
        PreparedStatement ps = connection.prepareStatement(query.toString());
        qb.fillPreparedStatement(ps, dbe);
        int rowsAffected = ps.executeUpdate();
        ps.close();
        return rowsAffected;
    }

    private <T> T createTypeInstance(DatabaseEntity dbe, ResultSet rs, boolean loadCollections) throws SQLException {
        try {
            T t = (T) dbe.getEntityClass().newInstance();
            List<String> fields = dbe.getAllFields();
            for(String field : fields) {
                Class fieldType = dbe.getFieldTypes().get(field);
                String column = dbe.getTableName()+"."+dbe.getFieldColumnMapping().get(field);
                Class entityClass = dbe.getEntityClass();
                String first = field.charAt(0)+"";
                String methodName = "set"+first.toUpperCase()+field.substring(1);
                Method method = entityClass.getDeclaredMethod(methodName, new Class[] {fieldType});

                if(dbe.getForeignKeys().contains(dbe.getFieldColumnMapping().get(field))) {
                    boolean isCollectionItem = dbe.getReferences().get(dbe.getFieldColumnMapping()
                            .get(field)).isIsCollectionItem();
                    if(!loadCollections || (loadCollections && !isCollectionItem)) {
                        DatabaseEntity dbe2 = dbe.getReferences().get(dbe.getFieldColumnMapping().get(field)).getDbe();
                        method.invoke(t, new Object[] {createTypeInstance(dbe2, rs, loadCollections)});
                        continue;
                    }
                }

//                if((dbe.getForeignKeys().contains(dbe.getFieldColumnMapping().get(field)) &&
//                        !dbe.getReferences().get(dbe.getFieldColumnMapping().get(field)).isIsCollectionItem())
//
//                        ||
//
//                        (dbe.getForeignKeys().contains(dbe.getFieldColumnMapping().get(field)) &&
//                        !dbe.getReferences().get(dbe.getFieldColumnMapping().get(field)).isIsCollectionItem() &&
//                        loadCollections)) {
//
//                    DatabaseEntity dbe2 = dbe.getReferences().get(dbe.getFieldColumnMapping().get(field)).getDbe();
//                    method.invoke(t, new Object[] {createTypeInstance(dbe2, rs, loadCollections)});
//                    continue;
//                } else {
//
//                }

                switch(fieldType.getSimpleName()) {
                    case "byte":
                        method.invoke(t, new Object[] {rs.getByte(column)});
                        break;
                    case "short":
                        method.invoke(t, new Object[] {rs.getShort(column)});
                        break;
                    case "int":
                        method.invoke(t, new Object[] {rs.getInt(column)});
                        break;
                    case "String":
                        method.invoke(t, new Object[] {rs.getString(column)});
                        break;
                    case "long":
                        method.invoke(t, new Object[] {rs.getLong(column)});
                        break;
                    case "float":
                        method.invoke(t, new Object[] {rs.getFloat(column)});
                        break;
                    case "double":
                        method.invoke(t, new Object[] {rs.getDouble(column)});
                        break;
                    case "boolean":
                        method.invoke(t, new Object[] {rs.getBoolean(column)});
                        break;
                    case "char":
                        method.invoke(t, new Object[] {rs.getString(column).charAt(0)});
                        break;
                    case "Date":
                        method.invoke(t, new Object[] {rs.getTimestamp(column)});
                        break;
                    default:
//                        method.invoke(t, new Object[] {rs.getInt(column)});
                }

                if(dbe.getParentEntities().containsKey(field) && loadCollections) {
                    DatabaseEntity.CollectionEntity ce = dbe.getParentEntities().get(field);
                    List<String> searchCriteria = new ArrayList<>();
                    String referencingField = ce.getReferencingField();
                    searchCriteria.add(referencingField);
                    String setterName = "set"+(referencingField.charAt(0)+"").toUpperCase()+referencingField.substring(1);
                    Object temp = ce.getChildEntityClass().newInstance();
                    Method setterMethod = ce.getChildEntityClass().getDeclaredMethod(setterName, new Class[] {dbe.getEntityClass()});
                    setterMethod.invoke(temp, new Object[] {t});
                    List list = loadEntities(temp, searchCriteria, loadCollections);
                    for(Object o : list) {
//                        Method setterMethod = ce.getChildEntityClass().getDeclaredMethod(setterName, new Class[] {fieldType});
                        setterMethod.invoke(o, new Object[] {t});
                    }
                    method.invoke(t, new Object[] {list});
                }
            }

            return t;
        } catch (InstantiationException ex) {
            System.out.println(ex.getClass().getSimpleName()+": "+ex.getMessage());
            ex.printStackTrace();
        } catch (IllegalAccessException ex) {
            System.out.println(ex.getClass().getSimpleName()+": "+ex.getMessage());
            ex.printStackTrace();
        } catch (NoSuchMethodException ex) {
            System.out.println(ex.getClass().getSimpleName()+": "+ex.getMessage());
            ex.printStackTrace();
        } catch (SecurityException ex) {
            System.out.println(ex.getClass().getSimpleName()+": "+ex.getMessage());
            ex.printStackTrace();
        } catch (IllegalArgumentException ex) {
            System.out.println(ex.getClass().getSimpleName()+": "+ex.getMessage());
            ex.printStackTrace();
        } catch (InvocationTargetException ex) {
            System.out.println(ex.getClass().getSimpleName()+": "+ex.getMessage());
            ex.printStackTrace();
        }
        return null;
    }
}


text:
<?php

namespace PlentymarketsAdapter\ReadApi;

class Availability extends ApiAbstract
{
    /**
     * @return array
     */
    public function findAll()
    {
        return $this->client->request('GET', 'availabilities');
    }
}


text:
layout: distribution
uid: kali
title: 'Kali Linux'
Category: Distribution
permalink: /distribution/kali
logo: kali-logo.png
preview: Kali_Linux.jpg
home_page: https://www.kali.org/
desktops: [gnome, plasma]
base : [debian]
tagline: The ultimate hacking distribution

description : "Kali Linux is a Debian (testing) based GNU/Linux distribution designed for digital forensic and peneteration testing. Stories and updates on Kali Linux"

releases:
  Kali Linux 2021.4: "/kali-linux-20214-has-been-released/"
  Kali Linux 2021.3: "/kali-2021.3-release/"
  Kali Linux 2021.2: "https://www.kali.org/blog/kali-linux-2021-2-release/"
  Kali Linux 2021.1: "/kali-2021.1-release/"
  Kali Linux 2020.4: "/kalilinux-2020.4-release/"
  Kali Linux 2020.3: "/kali-2020.3-release/"
  Kali Linux 2020.2: "/kali-2020.2-release/"
  Kali Linux 2019.4: "/1-kali-2019.4-screens/"
  Kali Linux 2019.03: "/1-kali-linux-2019.03-release/"
  Kali Linux 2018.3 : "/00-kali-linux-2018.03-released-with-linux-4.17/"
  Kali Linux 2018.1 : "http://open-source-feed.blogspot.com/2018/02/kali-linux-20181-released-with-amd.html"
  Kali Linux 2017.03 : "/kali-linux-201703-released/"
  Kali linux 2017.02 : "https://www.kali.org/news/kali-linux-2017-2-release/"
  Kali Linux 2017.01 : "http://open-source-feed.blogspot.com/2017/04/kali-linux-20171-released-with-cool.html"

screenshots:
  Kali Linux 2021.4: "/kali-linux-20214-has-been-released/"
  Kali Linux 2021.3: "/kali-2021.3-release/"
  Kali Linux 2020.2: "/kali-2020.2-release/"
  Kali Linux 2019.4: "/1-kali-2019.4-screens/"
---

Kali Linux (formerly known as BackTrack) is a Debian (testing) based GNU/Linux distribution designed for digital forensic and peneteration testing.

Kali Linux - a project maintained by Offensive security Ltd., includes numerous tools and packages for security assesment and other hacking activities.


text:
<!DOCTYPE HTML>

<title>News</title>

<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />

   	<link rel="stylesheet" href="fonts/css/font-awesome.min.css">

Learner

		      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
		        Toggle navigation

		      </button>

Home

Technologies

About

Users

Login

Sign Up

Safety & Quality News

IMO kids

ISO News

Recommended Practices for Safety and Health Programs in Construction

DOL Newsletter

OSHA Trenching and Excavation Safety

Walking-Working Surfaces and Fall Protection Rule

Fatalities Associated with Hot Work on Oil field Tanks (National STEP network )

© All rights reserved

s


text:
This procedure type allows you to perform a melt operation on a dataset. Melting
a dataset takes a set of columns to keep fixed and a set of columns to melt and
creates a new rows, one per column to melt, while copying as is the columns to
keep fixed.

An example usage is importing JSON data where some fields contain an array of
objects and the way we want to process it is one object per row.

## Configuration

![](%%config procedure melt)

## Example

### Example with a JSON array

Suppose the following dataset `data` with the `friends` column containing strings.

| rowName | name | age | friends |
|-----------|--------|-------|-----------|
| row1 | bill | 25 | [{"name": "mich", "age": 20}, {"name": "jean", "age": 18}] |

We may want to perform operations on the contents of the JSON object in the
`friends` column. To do so, we can perform a `melt` operation on the output
of the `parse_json()` function.

Doing the query `select parse_json(friends, {arrays: 'encode'}) from data` will return:

| rowName | 0 | 1 |
|-----------|--------|-------|-----------|
| row1 | {"name": "mich", "age": 20} | {"name": "jean", "age": 18} |

We can do the melt like this:

```python
mldb.post("/v1/procedures", {
    "type": "melt",
    "params": {
        "inputData": """
                    SELECT {name, age} as to_fix,
                           {friends*} as to_melt
                    FROM (
                        SELECT name, age,
                               parse_json(friends, {arrays: 'encode'}) AS friends
                        FROM data
                    )""",
        "outputDataset": "melted_data"
    }
})
```

The `melted_data` dataset will look like this:

| rowName | name | age | key | value |
|-----------|--------|-------|-----------|-----|
| result.friends.0 | bill | 25 | friends.0 | {"name": "mich", "age": 20} |
| result.friends.1 | bill | 25 | friends.1 | {"name": "jean", "age": 18} |

### Example with bags of words

Suppose the following dataset `data` containing a sentence per row:

| rowName | text |
|-----------|--------|
| row1 | hello my friend |
| row2 | hello it's me |

By running a `melt` procedure and using the `tokenize` function on the text,
we can obtain a new dataset with one row per *(rowName, word)* pair:

```python
mldb.post("/v1/procedures", {
    "type": "melt",
    "params": {
        "inputData": """
            SELECT {rowName() as rowName} as to_fix,
                   {tokenize(text, {splitChars: ' '}) as *} as to_melt
            FROM data
        """,
        "outputDataset": "melted_data"
    }
})
```
This gives us the following dataset:

| rowName | row | key | count |
|---------|-----|-----|-------|
| row1.my | row1  |  my | 1|
| row2.hello | row2 | hello | 1 |
| row2.me | row2 | me | 1 |
| row2.it's | row2 | it's | 1 |
| row1.friend | row1 | friend | 1 |
| row1.hello | row1 | hello | 1 |

## See also

* The [parse_json](../sql/ValueExpression.md.html#parse_json) builtin function can perform
JSON unpacking to a text cell in an SQL query


text:
'use strict';

import {Router} from 'express';
import * as controller from './user.controller';
import * as auth from '../auth/auth.service';

const router = new Router();

router.get('/users',auth.hasRole('admin'),controller.index);
router.post('/',auth.hasRole('admin'),controller.create);
router.put('/:id',auth.isAuthenticated(),controller.update);
router.delete('/:id',auth.hasRole('admin'),controller.remove);
router.get('/me',auth.isAuthenticated(),controller.me);
router.get('/',controller.honeypot);

module.exports = router


text:
package de.redoxi.ruste.core.parser;

import java.io.IOException;
import java.io.InputStream;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;

import de.redoxi.ruste.core.model.ast.ASTNode;

/**
 * Parser that parses the given Rust source with the "api" executable - a
 * wrapper around the syntax library used by the "rustc" compiler.
 *
 * @author Hayden Smith
 * @since 0.0.1
 */
public class NativeParser implements IRustParser {

	private IFile sourceFile;
	private IDocument sourceDocument;
	private InputStream sourceInputStream;

	private ASTNode root;
	private String name;

	@Override
	public ASTNode getRoot() {
		return root;
	}

	@Override
	public void setRoot(ASTNode root) {
		this.root = root;
	}

	public final String getName() {
		return name;
	}

	public final void setName(String name) {
		this.name = name;
	}

	@Override
	public void parse() {
		parseSource(name, getSourceString());
	}

	public void setSource(IFile file) {
		sourceFile = file;
	}

	@Override
	public void setSource(IDocument document) {
		sourceDocument = document;
	}

	public void setSource(InputStream inputStream) {
		sourceInputStream = inputStream;
	}

	private String getSourceString() {
		if (sourceDocument != null) {
			return sourceDocument.get();
		} else if (sourceInputStream != null) {
			return getSourceStringFromInputStream(sourceInputStream);
		} else if (sourceFile != null) {
			try {
				return getSourceStringFromInputStream(sourceFile.getContents(true));
			} catch (CoreException e) {
				getLogService().log(LogService.LOG_WARNING, "Unable to retrieve contents from source file '" + sourceFile.getName() + "'", e);
				return "";
			}
		} else {
			return null;
		}
	}

	private String getSourceStringFromInputStream(final InputStream is) {
		StringBuilder inputBuilder = new StringBuilder();
		byte[] readBuffer = new byte[1024];

		int read = 0;

		try {
			while ((read = is.read(readBuffer)) != -1) {
				inputBuilder.append(new String(readBuffer, 0, read));
			}

			is.close();
		} catch (IOException e) {
			getLogService().log(LogService.LOG_ERROR, "Unable to read from input stream", e);
		}

		return inputBuilder.toString();
	}

	private native void parseSource(String name, String source);

	/**
	 * @return The {@link LogService} for the
	 */
	private LogService getLogService() {
		final Bundle bundle = FrameworkUtil.getBundle(getClass());
		final ServiceTracker<LogService, LogService> tracker = new ServiceTracker<LogService, LogService>(bundle.getBundleContext(), LogService.class, null);
		return tracker.getService();
	}
}


text:
import React from 'react';
import {
  COLOR_ACTIVE_RECORD, COLOR_SQL, COLOR_OTHER,
  TYPE_ACTIVE_RECORD, TYPE_SQL, TYPE_CONTROLLER
} from '../../services/ProbeEvents';
import colorWheelHue from '../../utils/colorWheelHue';
import Breakdown from './Breakdown';

const round = num => ((num * 100) | 0) / 100;

const sumTime = events =>
  round(
    events.reduce((total, { duration }) =>
      total + duration, 0
    )
  );

const compareValue = ({ value: a }, { value: b }) => b - a;

const byType = (events=[]) => {
  if (events.length === 0) return [];

  const ar = sumTime(events.filter(e => e.type === TYPE_ACTIVE_RECORD));
  const sql = sumTime(events.filter(e => e.type === TYPE_SQL));
  const other = sumTime(events.filter(e => e.type === TYPE_CONTROLLER)) - (ar + sql);

  return [
    { label: 'ActiveRecord', value: ar,    color: COLOR_ACTIVE_RECORD },
    { label: 'SQL',          value: sql,   color: COLOR_SQL },
    { label: 'Other',        value: other, color: COLOR_OTHER },
  ].sort(compareValue);
}

const bySql = (events=[]) => {
  const sqlToEvent = new Map();
  events.forEach(({ duration, name, type }) => {
    if (type === TYPE_SQL) {
      sqlToEvent.set(name, duration + (sqlToEvent.get(name) || 0));
    }
  });

  return [...sqlToEvent.entries()]
    .map(([label, duration]) => ({ label, value: round(duration) }))
    .sort(compareValue)
    .map((item, i) => ({ ...item, color: `hsl(${colorWheelHue(i)}, 60%, 60%)` }));
}

export default ({ visibleEvents }) => (
  <div className='flex flex-grow flex--row'>
    <Breakdown items={visibleEvents} reducer={byType} unit='ms' />
    <Breakdown items={visibleEvents} reducer={bySql}  unit='ms' />
  </div>
);


text:
Fabricator(:user) do
  name { Faker::Name.name }
  nickname { |attrs| attrs[:name].downcase.underscore }
  description { Faker::Lorem.sentence }
  role { User::ROLES.sample }
  uid { sequence(:number, 1000000000)  }
end

# Create all of the user role Fabricators
# e.g. Fabricate(:listener) makes a User with the listener role
User::ROLES.each do |role|
  Fabricator(role.to_sym, from: :user) do
    role { role }
  end
end


text:
a {
	color: #C40A68 !important;
}

.primary-color {
	color: #C40A68;
}

.badge-pink {
	background: #C40A68;
}

.nav-list > .active > a, .nav-list > .active > a:hover {
	background-color: #222;
}

a.btn-primary {
	color: white !important;
}

.dropdown-menu li > a:hover {
	color: white !important;
}

body {
	background-image: url(../img/whitey.png);
}

.content-container {
	margin-top: 30px;
	padding: 10px;
	padding-left: 20px;
	border: 1px solid #d5d5d5;
	border-radius: 7px;
	background: whitesmoke;
	margin-bottom: 30px;
}

.talc-sheet {
	opacity: 0.8;
	background: white;
	z-index: 10000;
	position: fixed;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
}

.current-sprint {
	display: inline;
	float: left;
	border: 5px solid #ddd;
	border-radius: 10px;
	width: 25%;
	line-height: 20px;
	margin-top: 20px;
	margin-right: 20px;
	cursor: pointer;
}

.current-sprint:hover {
	-webkit-transition-property: -webkit-transform;
	-webkit-transform: scale(1.05,1.05);
	-webkit-transition-timing-function: ease-in-out;
	-webkit-transition-duration: 0.1s;
	-moz-transition-property: -moz-transform;
	-moz-transform: scale(1.05,1.05);
	-moz-transition-timing-function: ease-in-out;
	-moz-transition-duration: 0.1s;
}

.status-block {
	display: inline-block;
	height: 10px;
	width: 90%;
	border-radius: 10px;
	background: green;
}

/**** Transitions ****/

.masonry,
.masonry .masonry-brick {
  -webkit-transition-duration: 0.7s;
     -moz-transition-duration: 0.7s;
      -ms-transition-duration: 0.7s;
       -o-transition-duration: 0.7s;
          transition-duration: 0.7s;
}

.masonry {
  -webkit-transition-property: height, width;
     -moz-transition-property: height, width;
      -ms-transition-property: height, width;
       -o-transition-property: height, width;
          transition-property: height, width;
}

.masonry .masonry-brick {
  -webkit-transition-property: left, right, top;
     -moz-transition-property: left, right, top;
      -ms-transition-property: left, right, top;
       -o-transition-property: left, right, top;
          transition-property: left, right, top;
}

.task-summary {
	margin-left: 10px;
	float: left;
	cursor: pointer;
	border-color: #bbb;
	border-top-width: 4px;
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
	position: relative;
}

.task-summary-active {
	background-color: #eee;
}

.task-summary:hover {
	background-color: #eee;
}

.task-summary-popover-image {
	margin: 5px 2px;
}

.task-thumbnail {
	margin-left: 10px;
}

.thumbnail-container {
	overflow-x: auto;
	width: 95%;
	margin-left: auto;
	margin-right: auto;
	text-align: center
}

.thumbnail-content-details {
	position: absolute;
	bottom: 0px;
	padding-bottom: 10px;
	width: 96%;
	padding-top: 10px;
	float: left;
	display: none;
}

.thumbnail-active {

	border-color: #08C;
	-webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
	-moz-box-shadow: 0 1px 4px rgba(0,105,214,0.25);
	box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
}

a.thumbnail {
	position: relative;
}

.media:hover {
	background-color: gainsboro;
}

.media-active {
	background-color: gainsboro;
}

.comment-delete {
	display: none;
	float: right;
	margin-right: 5px;
	margin-top: 5px;
}

.btn-priority {
	margin-top: 20px;
	right: -40px;
}

.table-cell-control-container {
	vertical-align: middle !important;
	text-align: right !important;
	padding-right: 20px !important;
}

.current-sprint-container {
	margin-top: 15px;
	margin-bottom: 15px;
}


text:
GoAWK implements code coverage functionality, similar to the [code coverage built into Go](https://go.dev/blog/cover). This feature was implemented by Volodymyr Gubarkov ([xonixx](https://github.com/xonixx)), primarily in [PR #154](https://github.com/benhoyt/goawk/pull/154).

Here is a screenshot using GoAWK's coverage feature on a simple AWK program (`prog.awk`):

![Example code coverage screenshot](cover.png)

## Basic usage

The simplest way to generate a coverage report is to run your AWK program with the `-coverprofile` option. To run the program in the default coverage mode and write the coverage report to `cover.out`, run the following:

```
$ goawk -f prog.awk -coverprofile cover.out
will always run
should run
```

This generates a file `cover.out` with coverage profile data for the execution of `prog.awk`.

We rely on the Go toolchain to visualize the coverage report, specifically the `go tool cover` command. This command renders a coverage report to HTML. If you don't have Go installed, [install it now](https://go.dev/doc/install).

To write the HTML coverage report (like the one shown in the screenshot above) to a temporary file and open a web browser displaying it, run the following:

```
$ go tool cover -html=cover.out
```

To write the HTML file to a specified file instead of launching a web browser, use `-o`:

```
$ go tool cover -html=cover.out -o cover.html
```

If you want to see coverage-annotated source code, use the `-d` option in addition to `-covermode`. This might be useful for debugging, or to see how GoAWK's coverage feature works under the hood:

```
$ goawk -f prog.awk -covermode set -d
BEGIN {
    __COVER["3"] = 1
    print "will always run"
    if ((1 + 1) == 2) {
        __COVER["1"] = 1
        print "should run"
    } else {
        __COVER["2"] = 1
        print "won't run"
    }
}
```

## All command-line options

- `-coverprofile fn`: set the coverage report filename to `fn`. If this option is specified but `-covermode` is not, the coverage mode defaults to `set`.
- `-covermode mode`: set the coverage mode to `mode`, which can be one of:
  - `set`: did each statement run?
  - `count`: how many times did each statement run? (produces a heat map report)
- `-coverappend`: append to coverage profile instead of overwriting it. This allows you to accumulate coverage data across several different runs of the program.

## Future work

- Add a way to support per-function coverage reporting, similar to `go tool cover -func=cover.out`.
- More complete handling for coverage of `if`/`else` (see [details](https://github.com/benhoyt/goawk/pull/154#discussion_r996465307)).

## Feedback

Please [open an issue](https://github.com/benhoyt/goawk/issues) if you have bug reports or feature requests for GoAWK's code coverage support.