How to generate the good Configuration, depending on Saxon jar present

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to generate the good Configuration, depending on Saxon jar present

cmarchand
Hello,

I plan to distribute a product based on Saxon. I'll put a dependency son Saxon-HE.
But a final user may introduce a dependance on my product, excluding the saxon-HE dependency, and adding his own Saxon-PE or saxon-EE.

I want to generate a Configuration that match the saxon release/licence available.

I've done something like this :
    public static Configuration buildConfiguration() {
        try {
            Class clazz = Class.forName("com.saxonica.config.EnterpriseConfiguration");
            Configuration instance = (Configuration)clazz.newInstance();
            return instance;
        } catch(ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
            try {
                Class clazz = Class.forName("com.saxonica.config.ProfessionalConfiguration");
                Configuration instance = (Configuration)clazz.newInstance();
                return instance;
            } catch(ClassNotFoundException | InstantiationException | IllegalAccessException ex2) {
                return new Configuration();
            }
        }
    }


As my java code is entirely compatible with Saxon-HE, do I need to do this to be able to run XSLT with professional-only or enterprise-only features, or does using directly Configuration checks a saxon-licence availability ?
For example, may I declare/import a schema in an XSLT, running it with saxon-EE in classpath, but using a Configuration instead of a EnterpriseConfiguration ?

Best regards,
Christophe
--

Christophe MARCHAND

Consultant Formateur
[hidden email]
LD : (+33)1 84 19 19 76
GSM : +33 (0)6 23 41 09 17

oxiane

98, avenue du Général Leclerc
92100 Boulogne-Billancourt
Standard : (+33)1 55 60 76 72
Fax : (+33)1 55 60 76 73
www.oxiane.com



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to generate the good Configuration, depending on Saxon jar present

Michael Kay
There's a range of questions here, and I'm not sure I can disentangle them.

If you want to use a feature such as schema validation, then there are three preconditions:

* You must be using the Saxon-EE software (JAR file)

* You must have a license that enables that feature

* You must be running under an EnterpriseConfiguration (e.g. by starting with Processor proc = new Processor(true))

Generally speaking there are two kinds of licensable feature:

(a) features like schema validation which you explicitly invoke. This will fail if any of the above conditions is false.

(b) features like bytecode generation. These features will kick in if all the above conditions are true, and if any of them is false, you will get silent fallback to run without the feature.

I'm not quite sure if this answers the question...

Michael Kay
Saxonica


On 19 Apr 2016, at 12:32, Christophe Marchand <[hidden email]> wrote:

Hello,

I plan to distribute a product based on Saxon. I'll put a dependency son Saxon-HE.
But a final user may introduce a dependance on my product, excluding the saxon-HE dependency, and adding his own Saxon-PE or saxon-EE.

I want to generate a Configuration that match the saxon release/licence available.

I've done something like this :
    public static Configuration buildConfiguration() {
        try {
            Class clazz = Class.forName("com.saxonica.config.EnterpriseConfiguration");
            Configuration instance = (Configuration)clazz.newInstance();
            return instance;
        } catch(ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
            try {
                Class clazz = Class.forName("com.saxonica.config.ProfessionalConfiguration");
                Configuration instance = (Configuration)clazz.newInstance();
                return instance;
            } catch(ClassNotFoundException | InstantiationException | IllegalAccessException ex2) {
                return new Configuration();
            }
        }
    }


As my java code is entirely compatible with Saxon-HE, do I need to do this to be able to run XSLT with professional-only or enterprise-only features, or does using directly Configuration checks a saxon-licence availability ?
For example, may I declare/import a schema in an XSLT, running it with saxon-EE in classpath, but using a Configuration instead of a EnterpriseConfiguration ?

Best regards,
Christophe
--

Christophe MARCHAND

Consultant Formateur
[hidden email]
LD : (+33)1 84 19 19 76
GSM : +33 (0)6 23 41 09 17

<Oxiane_logo_bleu_183x50.png>

98, avenue du Général Leclerc
92100 Boulogne-Billancourt
Standard : (+33)1 55 60 76 72
Fax : (+33)1 55 60 76 73
www.oxiane.com


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to generate the good Configuration, depending on Saxon jar present

cmarchand
Ok, that's a part of the responses I need.
May I use a saxon:evaluate() call in an XSL, if I have only a Configuration, but a saxon-ee jar and a valid license ?
If I call new Processor(true), this will not fail if there is no available license. Do I have a method to force the license checking at this point ?

Best regards,
Christophe

Le 19/04/2016 13:47, Michael Kay a écrit :
There's a range of questions here, and I'm not sure I can disentangle them.

If you want to use a feature such as schema validation, then there are three preconditions:

* You must be using the Saxon-EE software (JAR file)

* You must have a license that enables that feature

* You must be running under an EnterpriseConfiguration (e.g. by starting with Processor proc = new Processor(true))

Generally speaking there are two kinds of licensable feature:

(a) features like schema validation which you explicitly invoke. This will fail if any of the above conditions is false.

(b) features like bytecode generation. These features will kick in if all the above conditions are true, and if any of them is false, you will get silent fallback to run without the feature.

I'm not quite sure if this answers the question...

Michael Kay
Saxonica


On 19 Apr 2016, at 12:32, Christophe Marchand <[hidden email]> wrote:

Hello,

I plan to distribute a product based on Saxon. I'll put a dependency son Saxon-HE.
But a final user may introduce a dependance on my product, excluding the saxon-HE dependency, and adding his own Saxon-PE or saxon-EE.

I want to generate a Configuration that match the saxon release/licence available.

I've done something like this :
    public static Configuration buildConfiguration() {
        try {
            Class clazz = Class.forName("com.saxonica.config.EnterpriseConfiguration");
            Configuration instance = (Configuration)clazz.newInstance();
            return instance;
        } catch(ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
            try {
                Class clazz = Class.forName("com.saxonica.config.ProfessionalConfiguration");
                Configuration instance = (Configuration)clazz.newInstance();
                return instance;
            } catch(ClassNotFoundException | InstantiationException | IllegalAccessException ex2) {
                return new Configuration();
            }
        }
    }


As my java code is entirely compatible with Saxon-HE, do I need to do this to be able to run XSLT with professional-only or enterprise-only features, or does using directly Configuration checks a saxon-licence availability ?
For example, may I declare/import a schema in an XSLT, running it with saxon-EE in classpath, but using a Configuration instead of a EnterpriseConfiguration ?

Best regards,
Christophe
--

Christophe MARCHAND

Consultant Formateur
[hidden email]
LD : (+33)1 84 19 19 76
GSM : +33 (0)6 23 41 09 17

<Oxiane_logo_bleu_183x50.png>

98, avenue du Général Leclerc
92100 Boulogne-Billancourt
Standard : (+33)1 55 60 76 72
Fax : (+33)1 55 60 76 73
www.oxiane.com


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to generate the good Configuration, depending on Saxon jar present

Michael Kay

May I use a saxon:evaluate() call in an XSL, if I have only a Configuration, but a saxon-ee jar and a valid license ?

Following the general rules, it should be a ProfessionalConfiguration. If its only a plain home Configuration then it will never look for a license, it doesn't have the capability to recognize a license.

If I call new Processor(true), this will not fail if there is no available license. Do I have a method to force the license checking at this point ?


Yes, you can call

 Configuration.isLicensedFeature(Configuration.LicenseFeature.PROFESSIONAL_EDITION)

Michael Kay
Saxonica


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to generate the good Configuration, depending on Saxon jar present

cmarchand
Thanks a lot !

Best regards,
Christophe

Le 19/04/2016 16:50, Michael Kay a écrit :

May I use a saxon:evaluate() call in an XSL, if I have only a Configuration, but a saxon-ee jar and a valid license ?

Following the general rules, it should be a ProfessionalConfiguration. If its only a plain home Configuration then it will never look for a license, it doesn't have the capability to recognize a license.

If I call new Processor(true), this will not fail if there is no available license. Do I have a method to force the license checking at this point ?


Yes, you can call

 Configuration.isLicensedFeature(Configuration.LicenseFeature.PROFESSIONAL_EDITION)

Michael Kay
Saxonica



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to generate the good Configuration, depending on Saxon jar present

cmarchand
In reply to this post by Michael Kay
And last question:
is new Processor(true) equivalent to new Processor(ProfessionalConfiguration) ?

Best
Christophe

Le 19/04/2016 16:50, Michael Kay a écrit :

May I use a saxon:evaluate() call in an XSL, if I have only a Configuration, but a saxon-ee jar and a valid license ?

Following the general rules, it should be a ProfessionalConfiguration. If its only a plain home Configuration then it will never look for a license, it doesn't have the capability to recognize a license.

If I call new Processor(true), this will not fail if there is no available license. Do I have a method to force the license checking at this point ?


Yes, you can call

 Configuration.isLicensedFeature(Configuration.LicenseFeature.PROFESSIONAL_EDITION)

Michael Kay
Saxonica



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to generate the good Configuration, depending on Saxon jar present

Michael Kay

On 19 Apr 2016, at 18:00, Christophe Marchand <[hidden email]> wrote:

And last question:
is new Processor(true) equivalent to new Processor(ProfessionalConfiguration) ?


No, it's rather more like

new Processor(Configuration.newConfiguration())

which gives you the highest level of Configuration available given the version of the Saxon software you are using (irrespective of whether you have a license for its functionality).

Michael Kay
Saxonica


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to generate the good Configuration, depending on Saxon jar present

Saravanan Kuppusamy
In reply to this post by cmarchand

Hi,

Please unsubscribe me.

On 19 Apr 2016 10:24 p.m., "Christophe Marchand" <[hidden email]> wrote:
Thanks a lot !

Best regards,
Christophe

Le 19/04/2016 16:50, Michael Kay a écrit :

May I use a saxon:evaluate() call in an XSL, if I have only a Configuration, but a saxon-ee jar and a valid license ?

Following the general rules, it should be a ProfessionalConfiguration. If its only a plain home Configuration then it will never look for a license, it doesn't have the capability to recognize a license.

If I call new Processor(true), this will not fail if there is no available license. Do I have a method to force the license checking at this point ?


Yes, you can call

 Configuration.isLicensedFeature(Configuration.LicenseFeature.PROFESSIONAL_EDITION)

Michael Kay
Saxonica



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...